[Bug target/23450] New: local functions should not sign extend results (and arguments) for speed reasons

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Aug 18 03:48:00 GMT 2005


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



More information about the Gcc-bugs mailing list