https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122735
Jeffrey A. Law <law at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |law at gcc dot gnu.org
--- Comment #4 from Jeffrey A. Law <law at gcc dot gnu.org> ---
The undefined nature is hidden until fwprop when we propagate in the shift
count at which point we can see the shift count is equal to the bitsize of the
object being shifted.
We could simplify in simplify-rtx down to an arbitrary constant given it's
undefined behavior. If we were to go that route, I'd suggest (const0_rtx). My
worry is more about long term maintenance (are we always required to simplify a
REG_EQUAL that exhibits undefined behavior?) as opposed to code generation
issues.
Another apporach would be to avoid doing down the simplify_gen_subreg path in
the new code when X isn't something we can legitimately subreg. The latter
looks like it would be fairly easy.