------- Comment #4 from dann at godzilla dot ics dot uci dot edu  2006-02-13 
02:34 -------
Here's another testcase of what seems to be the same problem. 
The 4.2 assembly contains 2 calls for TabSet, 4.0 only has 1.
(both this and the first example are function from xterm in case anybody
wonders)

typedef unsigned Tabs [10];
void TabSet(Tabs tabs, int col);

void
TabReset(Tabs tabs)
{
  int i;

  for (i = 0; i < 10; ++i)
    tabs[i] = 0;

  for (i = 0; i < ((1 << 5) * 10); i += 8)
    TabSet(tabs, i);
}

void
TabSet(Tabs tabs, int col)
{
  tabs[((col) >> 5)] |= (1 << ((col) & ((1 << 5)-1)));
}


4.2 assembly:

TabReset:
        pushl   %ebp
        movl    $2, %eax
        movl    %esp, %ebp
        pushl   %esi
        movl    8(%ebp), %esi
        pushl   %ebx
        movl    $0, (%esi)
.L4:
        movl    $0, -4(%esi,%eax,4)
        incl    %eax
        cmpl    $11, %eax
        jne     .L4
        pushl   $0
        movl    $8, %ebx
        pushl   %esi
        call    TabSet
        popl    %ecx
        popl    %eax
.L6:
        pushl   %ebx
        addl    $8, %ebx
        pushl   %esi
        call    TabSet
        cmpl    $320, %ebx
        popl    %eax
        popl    %edx
        jne     .L6
        leal    -8(%ebp), %esp
        popl    %ebx
        popl    %esi
        popl    %ebp
        ret


-- 


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

Reply via email to