https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89541
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we have
C.3857 = 1;
where the LHS is a CONST_DECL and this doesn't get a virtual definition.
This is arguably bad IL (a CONST_DECL LHS should have been rejected by
the GIMPLE verifier). We end up here from inlining
za (integer(kind=4) & restrict wl)
{
<bb 2> :
*wl_2(D) = 1;
return;
}
into
lh ()
{
<bb 2> :
za (&C.3856);
za (&C.3857);
return;
}
I guess this is invalid Fortran but only at runtime and the proper place
to "fix-up" is likely the inliner.
DCE happily removes all "stores" to CONST_DECLs w/o further consideration.