The problem is described here: https://bugs.gentoo.org/show_bug.cgi?id=505026
The code to trigger comes from a launchpad bug: https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1072650
As you may notice, it's acros distros and affects many compiler versions (confirmed for 4.6.3 on ubuntu, 4.7.3 and 4.8.2 on Gentoo).
Following code (AFAICT) violates strict aliasing rules:
unsigned int i;
unsigned int sum = 0;
struct psuedo_hdr hdr;
hdr.saddr = 0xaabbccdd;
hdr.daddr = 0x11223344;
hdr.zero = 0;
hdr.protocol = 6;
hdr.len = 2;
for (i = 0; i < sizeof(hdr); i += 2)
sum += *(short *)((char *)(&hdr) + i);
however, '-O2 -Wall' doesn't result in the strict aliasing warning.
The strict-aliasing warnings are broken - they are too easily to silence (the (char *) cast for example). Generally warning for TBAA violations is very hard if you want to avoid gazillions of false positives or gazillions of false negatives. The present warning code delivers neither :/