https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116466

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Your changes are wrong.  You can't change the mode of an existing pseudo
register like that.   In fact, given that the issue is only seen in the
intermediate form rather than in final assembly, I'm very tempted to just leave
this as-is.

In fact, it may not be possible to simplify.   operands[0] is always going to
be an SImode object for the case you're looking at.  The conditional branch
requires the object to be DImode because the hardware is going to compare all
64 bits.  A mixed mode comparison isn't going to work properly.

There are two ways to do the conversion.  You can either emit an extension like
the code does now or you can create a paradoxical subreg.  Either way there's
still going to be a statement in the IL for the conversion up through register
allocation.

I'd strongly suggest just ignoring the minor IL inefficiency.  The code in the
expander now is a pretty straightforward implementation of an overflow check
and the optimizers clean up the minor inefficiency before final code
generation.

Reply via email to