aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-05-23 10:08:33 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-05-23 10:08:33 +0000
commitaf6d44b57389b939aa515c177ce35d1e23b2cc07 (patch)
tree2369b240a34a2e78bdc300991b113f4ed7fbe628 /gcc/fold-const.c
parentbd3647bf76d1d207eaa80c7c6b5a460fecc327a9 (diff)
downloadgcc-af6d44b57389b939aa515c177ce35d1e23b2cc07.zip
gcc-af6d44b57389b939aa515c177ce35d1e23b2cc07.tar.gz
gcc-af6d44b57389b939aa515c177ce35d1e23b2cc07.tar.bz2
re PR rtl-optimization/57381 (array of volatile pointers hangs gcc)
2013-05-23 Richard Biener <rguenther@suse.de> PR middle-end/57381 * fold-const.c (operand_equal_p): Compare FIELD_DECLs with OEP_CONSTANT_ADDRESS_OF retained. * gcc.dg/torture/pr57381.c: New testcase. From-SVN: r199240
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index a2b7ac1..38db3f1 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2664,10 +2664,10 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
case COMPONENT_REF:
/* Handle operand 2 the same as for ARRAY_REF. Operand 0
may be NULL when we're called to compare MEM_EXPRs. */
- if (!OP_SAME_WITH_NULL (0))
+ if (!OP_SAME_WITH_NULL (0) || !OP_SAME (1))
return 0;
flags &= ~OEP_CONSTANT_ADDRESS_OF;
- return OP_SAME (1) && OP_SAME_WITH_NULL (2);
+ return OP_SAME_WITH_NULL (2);
case BIT_FIELD_REF:
if (!OP_SAME (0))