public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/23450] New: local functions should not sign extend results (and arguments) for speed reasons
@ 2005-08-18  3:48 pinskia at gcc dot gnu dot org
  2005-08-18  4:09 ` [Bug target/23450] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-18  3:48 UTC (permalink / raw)
  To: gcc-bugs

Just like regparm on x86, we should be able to not sign extend the return value (and arguments) for 
ppc64 for local functions which don't have their address taken.
An example is:

static int f(int a) __attribute__((noinline));

static int f(int a)
{
  return a+1;
}

int g(int a)
{
  return f(a+1);
}

For the example above, we remove two extsw which are useless.
I have no idea how much this will help real programs but it should help and not hurt.

-- 
           Summary: local functions should not sign extend results (and
                    arguments) for speed reasons
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc64-*-*


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


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

end of thread, other threads:[~2005-08-18  3:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-18  3:48 [Bug target/23450] New: local functions should not sign extend results (and arguments) for speed reasons pinskia at gcc dot gnu dot org
2005-08-18  4:09 ` [Bug target/23450] " pinskia at gcc dot gnu dot org

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).