[Bug c/68764] C frontend does not fold away trivial expressions that refer to const variables

ppalka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 7 12:58:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68764

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #1)
> I agree that this is weird but this is something the C FE likely shouldn't
> do.

One (possibly minor) obstacle with doing it in the middle-end is that the
DECL_INITIALs of non-static local variables are cleared during gimplification
so it is not all that simple to look up the definition of a const variable in
order to fold away its uses.


More information about the Gcc-bugs mailing list