public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/46942] New: x86_64 parameter passing unnecessary sign/zero extends
@ 2010-12-14 16:50 jakub at gcc dot gnu.org
  2010-12-14 17:13 ` [Bug target/46942] " jakub at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-12-14 16:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46942

           Summary: x86_64 parameter passing unnecessary sign/zero extends
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: hubicka@gcc.gnu.org
            Target: x86_64-linux


It seems we zero/sign extend < 64-bit integral parameters into 64-bit registers
both on the caller and callee side on x86_64, one of those should be redundant.
In http://blog.regehr.org/archives/320 Example 4 it seems that LLVM probably
only zero/sign extends in the caller, not callee, not sure what ICC does.

__attribute__((noinline, noclone))
unsigned long f1 (unsigned int a, int b, unsigned short c, short d, unsigned
char e, signed char f)
{
  return (unsigned long) a + b + c + d + e + f;
}

unsigned long l;

unsigned long f2 (void)
{
  return f1 (l + 41, l + 41, l + 41, l + 41, l + 41, l + 41);
}

unsigned long f3 (unsigned int a, int b, unsigned short c, short d, unsigned
char e, signed char f)
{
  return foo (a, b, c, d, e, f);
}


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-03-08  3:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-14 16:50 [Bug target/46942] New: x86_64 parameter passing unnecessary sign/zero extends jakub at gcc dot gnu.org
2010-12-14 17:13 ` [Bug target/46942] " jakub at gcc dot gnu.org
2010-12-14 17:26 ` joseph at codesourcery dot com
2010-12-16 15:12 ` rguenth at gcc dot gnu.org
2011-01-02 17:58 ` hjl.tools at gmail dot com
2011-01-02 17:59 ` hjl.tools at gmail dot com
2011-01-02 19:02 ` jakub at gcc dot gnu.org
2011-01-02 20:53 ` hjl.tools at gmail dot com
2011-01-03 14:23 ` hjl.tools at gmail dot com
2011-03-25 20:06 ` jakub at gcc dot gnu.org
2011-04-28 16:38 ` rguenth at gcc dot gnu.org
2012-03-08  3:42 ` meadori at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).