Reduced code: https://godbolt.org/z/chrT7v9vo ```cpp int m; void func(short a, short b) { short f = 1; if( (f ? ((a ? b : 0) ? 1 : 0) : 0) - (f ? ((a ? b : 0) ? 1 : 0) : 0) ){ m=1; } } ``` Clang-trunk: ```asm func(short, short): # @func(short, short) test si, si setne al sete cl test di, di setne dl sete sil and dl, al or sil, cl cmp dl, sil jne .LBB0_2 mov dword ptr [rip + m], 1 .LBB0_2: # %if.end ret ``` Expected code (Clang-18.1.0): ```asm func(short, short): # @func(short, short) ret ```