aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-scopedtables.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-01-19 13:27:11 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-01-19 13:27:11 +0000
commit879c27e3a3fd424e17690514bd52a7ebc0c1976f (patch)
treea5f8aac4273d3bb4f73465df51cb734ce2eb1b85 /gcc/tree-ssa-scopedtables.c
parent015337d35b4b3d5688162d24866b58a16a152f56 (diff)
downloadgcc-879c27e3a3fd424e17690514bd52a7ebc0c1976f.zip
gcc-879c27e3a3fd424e17690514bd52a7ebc0c1976f.tar.gz
gcc-879c27e3a3fd424e17690514bd52a7ebc0c1976f.tar.bz2
re PR tree-optimization/69336 (Constant value not detected)
2016-01-19 Richard Biener <rguenther@suse.de> PR tree-optimization/69336 * tree-ssa-scopedtables.c (avail_expr_hash): Handle all handled components with get_ref_base_and_extent. (equal_mem_array_ref_p): Adjust. * g++.dg/tree-ssa/pr69336.C: New testcase. From-SVN: r232559
Diffstat (limited to 'gcc/tree-ssa-scopedtables.c')
-rw-r--r--gcc/tree-ssa-scopedtables.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-ssa-scopedtables.c b/gcc/tree-ssa-scopedtables.c
index c421f43..613f50b 100644
--- a/gcc/tree-ssa-scopedtables.c
+++ b/gcc/tree-ssa-scopedtables.c
@@ -214,7 +214,7 @@ avail_expr_hash (class expr_hash_elt *p)
{
/* T could potentially be a switch index or a goto dest. */
tree t = expr->ops.single.rhs;
- if (TREE_CODE (t) == MEM_REF || TREE_CODE (t) == ARRAY_REF)
+ if (TREE_CODE (t) == MEM_REF || handled_component_p (t))
{
/* Make equivalent statements of both these kinds hash together.
Dealing with both MEM_REF and ARRAY_REF allows us not to care
@@ -252,9 +252,9 @@ avail_expr_hash (class expr_hash_elt *p)
static bool
equal_mem_array_ref_p (tree t0, tree t1)
{
- if (TREE_CODE (t0) != MEM_REF && TREE_CODE (t0) != ARRAY_REF)
+ if (TREE_CODE (t0) != MEM_REF && ! handled_component_p (t0))
return false;
- if (TREE_CODE (t1) != MEM_REF && TREE_CODE (t1) != ARRAY_REF)
+ if (TREE_CODE (t1) != MEM_REF && ! handled_component_p (t1))
return false;
if (!types_compatible_p (TREE_TYPE (t0), TREE_TYPE (t1)))