https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127606
--- Comment #11 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
The documentation for a paradoxical subreg has always said that the upper bits
are undefined, outside two enumerated cases (subreg of mem under
LOAD_EXTEND_OP, and SUBREG_PROMOTED_VAR_P). It has never said that two reads
would give the same upper bits.
So extending the semantics now looks risky to me. I guess some passes have
been written against the weak reading and are entitled to exploit
it. We may well end up with analogous problems outside the RA when some
optimizations assumes the undefined bits (like in the new transformation) are
the same and others are not.
Also I do not think this is the only place in the RA that would need updating
for the new semantics. Inheritance, splitting and rematerialization would all
have to be checked too.
As for proposed patch for reloading the inner part of the paradoxical subreg in
LRA, it could be done (it is mostly what old reload does). I would not expect a
large performance effect but I would like to see SPEC numbers first. I am
going to check this.