This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986


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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]