This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/25227] New: code generation -- unnecessary spill of structure onto stack
- From: "bcrl at kvack dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Dec 2005 18:13:51 -0000
- Subject: [Bug c/25227] New: code generation -- unnecessary spill of structure onto stack
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following test program spills res onto the stack when the value res.result,
which is already in a register, should be passed in a register to
foo();
/* compile with: gcc -fomit-frame-pointer -S */
struct rw_res {
long result;
long pos_update;
};
struct file {
long f_pos;
};
struct rw_res vfs_read(long pos);
long foo(long bar);
long sys_read(struct file *file)
{
struct rw_res res;
res = vfs_read(file->f_pos);
return foo(res.result);
}
--
Summary: code generation -- unnecessary spill of structure onto
stack
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bcrl at kvack dot org
GCC build triplet: x86_64-unknown-linux
GCC host triplet: x86_64-unknown-linux
GCC target triplet: x86_64-unknown-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25227