[Bug c/94010] [missed optimization] constant automatic string variable not elided
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Mar 3 08:33:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94010
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Version|4.9.0 |9.2.1
Keywords| |missed-optimization
Last reconfirmed| |2020-03-03
Component|tree-optimization |c
CC| |jsm28 at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org
Ever confirmed|0 |1
Summary|[missed optimization] |[missed optimization]
|-fmerge-all-constants |constant automatic string
|misses simple array merging |variable not elided
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
It isn't so much about -fmerge-all-constants, this is about not eliding
the automatic variable for the string constant.
Note it may be the language standard doesn't permit changing the
linkage of 'c', code may end up writing to it, expecting automatic
storage.
So this eliding could be done by the frontend already. Note there's heuristic
in the gimplifier to eventually emit a copy from a string constant rather
than doing inline initialization but the gimplifier cannot really elide the
variable.
Also this must have come up in the past.
More information about the Gcc-bugs
mailing list