https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86891
Wilco <wilco at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2018-12-20 CC| |wilco at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |wilco at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #3 from Wilco <wilco at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #1) > Now, looking at what aarch64 does for add with carry, there are separate > patterns like add<mode>3_carryinC which set CC_C mode and use zero_extend > and add<mode>3_carryinV which sets CC_V mode and uses sign_extend. > So, shouldn't sub<mode>3_carryin{C,V} be split similarly and if we check > carry flag, we should use subdi3_carryinC? Yes it looks like the pattern confuses signed and unsigned underflow. Changing it to zero_extend and using minus for the compare fixes the reported issue, but it's not possible to support signed and unsigned in a single pattern.