diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-03-03 12:29:51 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-03-03 12:29:51 +0100 |
commit | f07049c8f1741e8a56f8e6dc3702216a652a532d (patch) | |
tree | 72080893386c672511d6291de515bd51b739d6f2 /gcc/tree-ssa-ccp.c | |
parent | fc0ffad7cba0735ea2b159aaf00521b9c8da2319 (diff) | |
download | gcc-f07049c8f1741e8a56f8e6dc3702216a652a532d.zip gcc-f07049c8f1741e8a56f8e6dc3702216a652a532d.tar.gz gcc-f07049c8f1741e8a56f8e6dc3702216a652a532d.tar.bz2 |
re PR tree-optimization/39343 (Wrong result for __builtin_object_size (x, 1))
PR tree-optimization/39343
* tree-ssa-ccp.c (maybe_fold_offset_to_address): Don't check if
COMPONENT_REF t has ARRAY_TYPE.
* gcc.dg/pr39343.c: New test.
From-SVN: r144571
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index d602726..5080cc3 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1942,8 +1942,7 @@ maybe_fold_offset_to_address (tree addr, tree offset, tree orig_type) || (TREE_CODE (orig) == COMPONENT_REF && TREE_CODE (TREE_TYPE (TREE_OPERAND (orig, 1))) == ARRAY_TYPE)) && (TREE_CODE (t) == ARRAY_REF - || (TREE_CODE (t) == COMPONENT_REF - && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 1))) == ARRAY_TYPE)) + || TREE_CODE (t) == COMPONENT_REF) && !operand_equal_p (TREE_CODE (orig) == ARRAY_REF ? TREE_OPERAND (orig, 0) : orig, TREE_CODE (t) == ARRAY_REF |