[Bug c/94010] [missed optimization] constant automatic string variable not elided
joseph at codesourcery dot com
gcc-bugzilla@gcc.gnu.org
Tue Mar 3 22:16:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94010
--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
See bug 59863, with discussion of the requirement for distinct copies of
the array in recursive calls to have distinct addresses. (Thus, this
would definitely not be valid without -fmerge-all-constants, as the
example in this bug could involve a recursive call - whereas the example
in bug 59863 does not involve the address of the const array escaping, so
the transformation would be valid in that example even without
-fmerge-all-constants. It's not valid for code to write to an array
defined as const, however.)
More information about the Gcc-bugs
mailing list