Extracted from http://embed.cs.utah.edu/embarrassing/dec_09/harvest/gcc-head_llvm-gcc-head/ I've seen this in multiple examples both compared to llvm and icc. The other compilers merge adjacent stores to structures in memory, gcc doesn't. Simple toy example: struct foo { short a; char c; char d; int x; }; void f(struct foo *f) { f->a = 1; f->c = 0; f->d = 1; f->x = 0; } generates with -O2 -S -mtune=generic 4.5.0 20091219 movw $1, (%rdi) movb $0, 2(%rdi) movb $1, 3(%rdi) movl $0, 4(%rdi) but since everything is aligned it could be just (from icc) movl $16777217, (%rdi) #11.2 movl $0, 4(%rdi) #14.2 (possibly even a single movq, exploiting CPUs with very fast misalignment support like Nehalem)
Old problem - there's a duplicate report even somewhere with a patch from Jakub.
Not sure, but looks like a dup of bug 22141.
It is. *** This bug has been marked as a duplicate of 22141 ***