https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68764
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Patrick Palka from comment #2) > (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. Only if explicit assignments are instead added.