Commit af6d44b5 by Richard Biener Committed by Richard Biener

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
parent bd3647bf
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.
2013-05-23 Jakub Jelinek <jakub@redhat.com> 2013-05-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/57344 PR middle-end/57344
......
...@@ -2664,10 +2664,10 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) ...@@ -2664,10 +2664,10 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
case COMPONENT_REF: case COMPONENT_REF:
/* Handle operand 2 the same as for ARRAY_REF. Operand 0 /* Handle operand 2 the same as for ARRAY_REF. Operand 0
may be NULL when we're called to compare MEM_EXPRs. */ 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; return 0;
flags &= ~OEP_CONSTANT_ADDRESS_OF; flags &= ~OEP_CONSTANT_ADDRESS_OF;
return OP_SAME (1) && OP_SAME_WITH_NULL (2); return OP_SAME_WITH_NULL (2);
case BIT_FIELD_REF: case BIT_FIELD_REF:
if (!OP_SAME (0)) if (!OP_SAME (0))
......
2013-05-23 Richard Biener <rguenther@suse.de>
PR middle-end/57381
* gcc.dg/torture/pr57381.c: New testcase.
2013-05-23 Jakub Jelinek <jakub@redhat.com> 2013-05-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/57344 PR middle-end/57344
......
/* { dg-do compile } */
struct S0 { int f0, f1, f2; };
struct S1 {
int f0;
volatile struct S0 f2;
};
static struct S1 s = {0x47BED265,{0x06D4EB3E,5,0U}};
int foo(struct S0 p)
{
for (s.f2.f2 = 0; (s.f2.f2 <= 12); s.f2.f2++)
{
volatile int *l_61[5][2][2] = {{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,(void*)0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{(void*)0,&s.f2.f0}}};
volatile int **l_68 = &l_61[0][0][1];
volatile int *l_76 = &s.f2.f0;
(*l_68) = l_61[0][0][0];
if ((*l_76 = (p.f2 % 5))) ;
}
return p.f0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment