https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114518
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Component|testsuite |rtl-optimization --- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The reason why late_combine1 does not do it is because we have: failed to match this instruction: (set (reg:SI 123 [ _2 ]) (and:SI (ashiftrt:SI (reg:SI 125 [ xD.3519 ]) (const_int 14 [0xe])) (const_int 6 [0x6]))) BUT combine is able to change the ashiftrt into lshiftrt and that matches. I am not sure where we should put that transformation or should the target have a matching pattern for the above and make sure the const value of the and does NOT have the sign bit set.