https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112274
--- Comment #1 from Stefan Schulze Frielinghaus <stefansf at gcc dot gnu.org> --- I cannot reproduce the problem, i.e., I tried it on Ubuntu 22.04 natively and also via a cross+qemu and in both cases a zero is printed while using -O2 or -O3. The generated assembly also looks good to me: lhrl %r1,.LANCHOR0 chrl %r1,.LANCHOR0+2 // g_4 < g_8 lghi %r4,0 locghil %r4,1 larl %r3,.LC0 lghi %r2,1 brasl %r14,__printf_chk@PLT