This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Jan 2015 15:35:06 +0000
- Subject: [Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
- Auto-submitted: auto-generated
- References: <bug-64353-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64353
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note the testcase is bogus because xx is clearly loading from global memory and
thus should be pure only.
Of course we should still not ICE here and treat xx as if it were const.
One possibility is to simply never apply IPA SRA to const functions.
Note that we will miscompile things if you change C::i to
void C::i()
{
x = 1;
if (xx())
x = 0;
}
and you add noinline to xx. sinking will then sink the x = 1 store
to the else arm (because of the bogus const attribute).