[Bug c/25227] New: code generation -- unnecessary spill of structure onto stack
bcrl at kvack dot org
gcc-bugzilla@gcc.gnu.org
Fri Dec 2 18:13:00 GMT 2005
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
More information about the Gcc-bugs
mailing list