[Bug target/23303] [4.1 Regression] 4.1 generates sall + addl instead of leal

steven at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Aug 14 15:48:00 GMT 2005


------- Additional Comments From steven at gcc dot gnu dot org  2005-08-14 15:48 -------
Smaller test case: 
===================================================== 
typedef struct { 
  char **visbuf; 
  char **allbuf; 
} TScreen; 
 
void 
VTallocbuf(TScreen *screen, unsigned long savelines) 
{ 
  screen->visbuf = &screen->allbuf[savelines]; 
} 
===================================================== 
 
On AMD64 this gives me: 
        salq    $3, %rsi 
        addq    8(%rdi), %rsi 
        movq    %rsi, (%rdi) 
        ret 
 
instead of 
        movq    8(%rdi), %rax 
        leaq    (%rax,%rsi,8), %rsi 
        movq    %rsi, (%rdi) 
        ret 
 

-- 


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



More information about the Gcc-bugs mailing list