https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106822

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The reason for the difference is because in the case where there is an int in
the structure, the alignment is 4 bytes so a 2 or 4 byte read for a and b will
not cause an fault while in the first case where there is no int, the alignment
is 1 and might cause a fault. Gcc is conservative here on doing the
optimization.

Also || is a short cutting or in c so I don't think this optimization can be
done for the original case in a well defined way.

Reply via email to