diff options
author | Richard Guenther <rguenther@suse.de> | 2010-04-30 08:22:15 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-04-30 08:22:15 +0000 |
commit | 4be68d9a2d50985d79835f109a46d7665eec721a (patch) | |
tree | 44218b6855bc66127f9b11af7c5a184ffc5ce829 /gcc/tree-ssa-structalias.c | |
parent | 0646825443aef1495f97f719f91fdc7a5c1e26f8 (diff) | |
download | gcc-4be68d9a2d50985d79835f109a46d7665eec721a.tar.gz |
re PR tree-optimization/43879 (-fipa-pta causes various miscompilations)
2010-04-30 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43879
* tree-ssa-structalias.c (get_constraint_for_1): Properly
handle non-zero initializers.
* gcc.dg/torture/pr43879_1.c: New testcase.
From-SVN: r158924
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 08d3fa7e15b..928dc04d131 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3285,8 +3285,10 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p) && ((TREE_CODE (t) == INTEGER_CST && integer_zerop (t)) /* The only valid CONSTRUCTORs in gimple with pointer typed - elements are zero-initializer. */ - || TREE_CODE (t) == CONSTRUCTOR)) + elements are zero-initializer. But in IPA mode we also + process global initializers, so verify at least. */ + || (TREE_CODE (t) == CONSTRUCTOR + && CONSTRUCTOR_NELTS (t) == 0))) { temp.var = nothing_id; temp.type = ADDRESSOF; |