diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-11 08:32:29 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-11 08:32:29 +0000 |
commit | 8edd00b27ca19ebc517e1937a41fc86c290f67a1 (patch) | |
tree | 98c427e048e3281aefa608f46fb037c66bd0f9e8 /gcc/gimple.c | |
parent | cef94116307313211b4fa86d7779781713691b96 (diff) | |
download | gcc-8edd00b27ca19ebc517e1937a41fc86c290f67a1.tar.gz |
2012-09-11 Richard Guenther <rguenther@suse.de>
PR middle-end/54515
* gimple.c (get_base_address): Do not return NULL_TREE apart
from for WITH_SIZE_EXPR.
* gimple-fold.c (canonicalize_constructor_val): Do not call
get_base_address when not necessary.
* g++.dg/tree-ssa/pr54515.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191174 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index 88fa7627e84..f639869e726 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -2878,16 +2878,12 @@ get_base_address (tree t) && TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR) t = TREE_OPERAND (TREE_OPERAND (t, 0), 0); - if (TREE_CODE (t) == SSA_NAME - || DECL_P (t) - || TREE_CODE (t) == STRING_CST - || TREE_CODE (t) == CONSTRUCTOR - || INDIRECT_REF_P (t) - || TREE_CODE (t) == MEM_REF - || TREE_CODE (t) == TARGET_MEM_REF) - return t; - else + /* ??? Either the alias oracle or all callers need to properly deal + with WITH_SIZE_EXPRs before we can look through those. */ + if (TREE_CODE (t) == WITH_SIZE_EXPR) return NULL_TREE; + + return t; } void |