http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47980
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Component|c |middle-end
Resolution| |INVALID
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-03-03
22:00:36 UTC ---
Actually the copying is correct.
Take:
void f(const char *p);
void g(int t) {
const char foo[] = "aoeuaoeuaeouaeouaoeuaoeaoxbxod";
f(foo, t);
if (!t)
g(1);
}
const char *a;
void f(const char *p, int t)
{
if (!t)
a = p;
else if (a == p)
abort ();
}
void main(void)
{
g(0);
}
This program should not abort with your "optimization", it will.