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