[Bug ipa/84658] [7/8 Regression] -O3 -fmerge-all-constants causes incorrect for-each loop generation.
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 5 09:58:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84658
--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
So you can loses the TREE_ADDRESSABLE restriction somewhat in requiring at most
one decl to be TREE_ADDRESSABLE - that's the one you need to keep, the others
may become aliases. Given TREE_ADDRESSABLE isn't reliable for !TREE_STATIC
vars
we can't merge any exported decls that way. Consider
const int foo1;
const int foo2;
int *bar(); // in other TU, returns address of foo1
int main ()
{
if (bar() != &foo2)
...;
}
not sure if we want to do hand-waving saying that we can't possibly have
points-to sets mentioning those without seeing the function IL. Well,
might be similarly hand-waving as the reference aliasing issue.
So we could drop the TREE_STATIC restriction if TREE_ADDRESSABLE is reliable
within the current TU.
More information about the Gcc-bugs
mailing list