https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106502
--- Comment #7 from Jonathan Wakely ---
The way I found the bug might be, but the bug itself is nothing to do with
that.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106502
Eric Gallager changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106502
--- Comment #5 from Jonathan Wakely ---
I noticed this by adding a printf statement to the const function for temporary
debugging purposes, which is obviously incorrect and not a problem for real
code. It's not observable that it gets called mor
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106502
--- Comment #4 from Richard Biener ---
Once you enable optimization a single cat () call remains (as expected). The
FE does
9931 if (TREE_SIDE_EFFECTS (argarray[0]))
9932argarray[0] = save_expr (argarray[0]);
9933
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106502
--- Comment #3 from Jonathan Wakely ---
It doesn't happen unless the name() function is virtual. Reduced:
extern "C" int puts(const char*);
struct Cat
{
virtual const char* name();
};
__attribute__((const)) Cat& cat();
int main()
{
puts
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106502
Andrew Pinski changed:
What|Removed |Added
Keywords||missed-optimization
--- Comment #2 from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106502
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Ever confirmed|0