[Bug tree-optimization/93891] CSE where clobber writes the same value
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 25 11:20:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93891
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
While the last_vuse thing was originally added for PRE it's also useful for
FRE as the following testcase shows:
int foo(int *p, int b, float *q)
{
int tem;
if (b)
{
*q = 0;
tem = *p;
}
else
{
*q = 1;
tem = *p;
}
return *p - tem;
}
with last_vuse fre1 manages to optimize this to return 0 while w/o it doesn't
(the key is value-numbering loads from both if arms the same).
More information about the Gcc-bugs
mailing list