https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125728
--- Comment #2 from Mikael Pettersson <mikpelinux at gmail dot com> ---
The difference is first seen in .305r.late_combine1:
-(insn 6 5 7 2 (set (reg:QI 37 [ _5 ])
- (and:QI (mem/c:QI (symbol_ref:SI ("foo") [flags 0x2] <var_decl
0x7fbbc7478980 foo>) [0 foo+0 S1 A16])
- (const_int 7 [0x7]))) "/tmp/pr125728.c":6:20 251 {andqi3}
+(insn 7 5 8 2 (set (reg:SI 38 [ _2 ])
+ (and:SI (mem/c:SI (const:SI (plus:SI (symbol_ref:SI ("foo") [flags
0x2] <var_decl 0x7fcd5e89b980 foo>)
+ (const_int -3 [0xfffffffffffffffd]))) [0 foo+-3 S4
A8])
+ (const_int 7 [0x7]))) "/tmp/pr125728.c":6:20 246 {andsi3_internal}
(nil))
-(insn 7 6 8 2 (set (reg:SI 38 [ _2 ])
- (zero_extend:SI (reg:QI 37 [ _5 ]))) "/tmp/pr125728.c":6:20 90
{zero_extendqisi2}
- (expr_list:REG_DEAD (reg:QI 37 [ _5 ])
- (nil)))
That (mem:SI (const:SI (plus:SI (symbol_ref:SI ("foo")) (const_int -3)))) is
clearly invalid on a strict-alignment target.