https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979
--- Comment #36 from Oleg Endo <olegendo at gcc dot gnu.org> --- It seems the tstsi peephole is still wrong. While working on AMS the following example: int test (char* x, char* y, int z) { return ((x[2] & x[3]) == 0) + z; } silently produced wrong code by omitting one of the two mem loads. After an update to the current trunk it results in sh_tmp.cpp: In function 'int test(char*, char*, int)': sh_tmp.cpp:6:1: error: insn does not satisfy its constraints: } ^ (insn 88 69 89 2 (set (reg:SI 1 r1) (sign_extend:SI (mem:QI (plus:SI (reg/v/f:SI 4 r4 [orig:169 x ] [169]) (const_int 3 [0x3])) [0 MEM[(char *)x_1(D) + 3B]+0 S1 A8]))) sh_tmp.cpp:5 232 {*extendqisi2_compact_mem_disp} (nil)) which I think is the same as PR 66611. The tstsi related peephole at line 14709 is causing the trouble.