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.

Reply via email to