diff options
author | Richard Guenther <rguenther@suse.de> | 2010-05-03 16:12:12 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-05-03 16:12:12 +0000 |
commit | 8eb7bc3cda0c8a6560712056642b5dff43895f74 (patch) | |
tree | a92f9510fa143f7221f6a70ec0a5721b86f12e77 /gcc/tree-ssa-structalias.c | |
parent | c4e26da143564e081c6c68ae5a7e32647fbea8ac (diff) | |
download | gcc-8eb7bc3cda0c8a6560712056642b5dff43895f74.zip gcc-8eb7bc3cda0c8a6560712056642b5dff43895f74.tar.gz gcc-8eb7bc3cda0c8a6560712056642b5dff43895f74.tar.bz2 |
re PR tree-optimization/43971 (index domain error in tree-ssa-structalias.c:3450)
2010-05-03 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43971
* tree-ssa-structalias.c (get_constraint_for_1): Fix
constraints in the !flag_delete_null_pointer_checks case.
* gcc.dg/pr43971.c: New testcase.
From-SVN: r158991
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index fce39de..89b5c9c 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3286,16 +3286,18 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p) in that case *NULL does not fail, so it _should_ alias *anything. It is not worth adding a new option or renaming the existing one, since this case is relatively obscure. */ - if (flag_delete_null_pointer_checks - && ((TREE_CODE (t) == INTEGER_CST - && integer_zerop (t)) - /* The only valid CONSTRUCTORs in gimple with pointer typed - 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; + if ((TREE_CODE (t) == INTEGER_CST + && integer_zerop (t)) + /* The only valid CONSTRUCTORs in gimple with pointer typed + 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)) + { + if (flag_delete_null_pointer_checks) + temp.var = nothing_id; + else + temp.var = anything_id; temp.type = ADDRESSOF; temp.offset = 0; VEC_safe_push (ce_s, heap, *results, &temp); |