Hi, SRA gimple passes may add loads to functions with no SSA update. Later it causes ICE when function with not updated SSA is processed by gimple passes. This patch fixes it by calling update_ssa.
Bootstrapped and checked on x86_64-unknown-linux-gnu. OK for trunk? Thanks, Ilya -- gcc/ 2015-01-14 Ilya Enkovich <ilya.enkov...@intel.com> PR middle-end/64353 * ipa-prop.c (ipa_modify_call_arguments): Update SSA for vops after adding a load. gcc/testsuite/ 2015-01-14 Ilya Enkovich <ilya.enkov...@intel.com> PR middle-end/64353 * g++.dg/pr64353.C: New. diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 01f4111..533dcfe 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -4054,6 +4054,8 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gcall *stmt, expr = create_tmp_reg (TREE_TYPE (expr)); gimple_assign_set_lhs (tem, expr); gsi_insert_before (&gsi, tem, GSI_SAME_STMT); + if (gimple_in_ssa_p (cfun)) + update_ssa (TODO_update_ssa_only_virtuals); } } else diff --git a/gcc/testsuite/g++.dg/pr64353.C b/gcc/testsuite/g++.dg/pr64353.C new file mode 100644 index 0000000..7859918 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr64353.C @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +class C +{ + int y, x; + void i (); + bool __attribute__((const)) xx () { return x; } +}; + +void C::i () +{ + if (xx ()) + x = 1; +}