Commit 8683f051 by Jan Hubicka Committed by Jan Hubicka

gimple.c (maybe_fold_reference): Verify that operand is gimple_min_invariant.


	* gimple.c (maybe_fold_reference): Verify that operand is
	gimple_min_invariant.
	* gcc.c-torture/compile/20100907.c: New testcase.

From-SVN: r163948
parent f5e5b46c
2010-09-07 Jan Hubicka <jh@suse.cz>
* gimple.c (maybe_fold_reference): Verify that operand is
gimple_min_invariant.
2010-09-07 Richard Guenther <rguenther@suse.de>
PR middle-end/45569
......
......@@ -477,7 +477,8 @@ maybe_fold_reference (tree expr, bool is_lhs)
tree result;
if (!is_lhs
&& (result = fold_const_aggregate_ref (expr)))
&& (result = fold_const_aggregate_ref (expr))
&& is_gimple_min_invariant (result))
return result;
/* ??? We might want to open-code the relevant remaining cases
......
2010-09-07 Jan Hubicka <jh@suse.cz>
* gcc.c-torture/compile/20100907.c: New testcase.
2010-09-07 Richard Guenther <rguenther@suse.de>
PR middle-end/45569
......
struct a {int a,b;};
const static struct a a[1]={{1,2}};
struct a b,c;
t()
{
int idx = 0;
b=a[idx];
c=a[idx];
}
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