[Bug tree-optimization/103565] GCC emits more assembly than clang for carry flag

2021-12-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103565 --- Comment #2 from Andrew Pinski --- The difference is just argument and return register differences (and maybe a register allocation issue). That is the extra instructions are: for add_carry_pattern_test: movzx edi, dil mov

[Bug tree-optimization/103565] GCC emits more assembly than clang for carry flag

2021-12-05 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103565 --- Comment #1 from cqwrteur --- https://godbolt.org/z/bGfY6zh9x #include template inline constexpr bool add_carry_pattern(bool carry,T a,T b,T& out) noexcept { T temp{carry+a}; out=temp+b; return (out < b) | (temp <