https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110304
--- Comment #19 from cqwrteur <unlvsur at live dot com> --- (In reply to cqwrteur from comment #18) > Would you mind if I clarified a few points regarding your query? I'm > referring to implementing "sub borrow" with sub_overflow, as demonstrated in > the code snippet at https://godbolt.org/z/ev3TfeTvd , correct? > > Additionally, I'd like to inquire about the possibility of enabling the > compiler to comprehend the "carry + set value" pattern. For instance, in the > given example: > carry = sub_carry(false, a, b, c); > unsigned v { carry ? 38u : 0u }; > > To clarify, the intention is to utilize the carry flag for subtraction > operations where a register subtracts itself and then performs a bitwise AND > operation with a specified value. > carry = sub_carry(false, a, b, c); > unsigned v; > carry = sub_carry(carry, v, v, v); > v &= 38u; I have noticed that the generated assembly from the subzeroproblem function does not align with my expectations.