[Bug target/45026] Empty function compiles to many loads and stores
sje at cup dot hp dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 26 20:08:00 GMT 2010
------- Comment #1 from sje at cup dot hp dot com 2010-07-26 20:07 -------
It doesn't result in any loads, just stores. This code is storing the first
part of the structure argument which was passed (partially) in registers into
memory. Obviously it doesn't need to do this since the argument isn't used. I
think this is an unfortunate side-effect of passing a large structure as an
argument. If the structure were smaller and fit entirely into registers you
would see an empty function. Large structures are split on IA64 with the first
part going into registers and the last part going into memory and it looks like
GCC 'reconstructs' the structure in memory before determining if it is needed
or not.
Ideally, you should pass a pointer here instead of passing (and copying) the
structure, but it would be nice if GCC realised the argument wasn't needed and
didn't do the stores so this could be considered a missed optimization.
--
sje at cup dot hp dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sje at cup dot hp dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45026
More information about the Gcc-bugs
mailing list