[Bug rtl-optimization/123905] Failure to optimize away sign extension on RISC-V

law at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 12 22:08:41 GMT 2026


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|120763                      |

--- Comment #2 from Jeffrey A. Law <law at gcc dot gnu.org> ---
So, yes it looks like at least part of the problem is failure to recognize
these opcodes in num_sign_bit_copies.

It's also the case that ext-dce is failing to eliminate some of the crud in
here.  

With those most obvious things fixed we're getting extraneous andi's with the
constant 127.  So something still amiss with tracking, but so far I haven't
seen anything unfixable.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120763
[Bug 120763] [meta-bug] Tracker for bugs to visit during weekly RISC-V meeting


More information about the Gcc-bugs mailing list