This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-18 03:48 -------
I will be looking into this after working a libjava patch.

Note the current asm is:
_f:
        addi r3,r3,1
        extsw r3,r3
        blr
        .align 2
        .p2align 4,,15
        .globl _g
_g:
        addi r3,r3,1
        extsw r3,r3
        b _f

This is most likely can apply to x86_64 also so if someone over there should look into it.

This also applies to all non-register sized types really and 32bit.
for another example:
static char f(char a) __attribute__((noinline));

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

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


(this is much worse) (at -O2 -m32):
_f:
        addi r3,r3,1
        extsb r3,r3
        blr
        .align 2
        .globl _g
_g:
        mflr r0
        addi r3,r3,1
        extsb r3,r3
        stw r0,8(r1)
        stwu r1,-80(r1)
        bl _f
        addi r1,r1,80
        lwz r0,8(r1)
        mtlr r0
        blr

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-18 03:48:22
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]