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

--- Comment #6 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #5)
> For that code sh1add would be wrong on rv64.  Think about bits 32..63. 
> Those must be a copy of bit 31 for ABI semantics -- which won't be the case
> if we used shNadd.
> 
> Try it with a "long"  rather than an "int" :-)

AH, so the addiw for the sequence that is ok, does the sign-extend for us.  Ok,
I'm still learning the riscv ISA.  Thanks for the education!

Reply via email to