This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/42594] New: no store merging for structure stores
- From: "andi-gcc at firstfloor dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jan 2010 13:09:16 -0000
- Subject: [Bug rtl-optimization/42594] New: no store merging for structure stores
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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)
--
Summary: no store merging for structure stores
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andi-gcc at firstfloor dot org
GCC host triplet: x86_64-linux
GCC target triplet: x86_64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42594