[Bug tree-optimization/94293] [missed optimization] Useless statements populating local string not removed
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 23 22:00:09 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94293
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
Or just
void f(){
int*p=new int[1];
*p=42;
delete[] p;
}
while it does optimize for
void f(){
int*p=new int;
*p=42;
delete p;
}
because the front-end gives us a clobber before operator delete.
More information about the Gcc-bugs
mailing list