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]

incomprehensible register allocation on alpha


I've been seeing so many fmovs generated on the alpha with the
mainline compiler that I tried the following small function:

void test_float (double *a, double *b, double *c, int n) {
  int i;
  for (i=0; i<n; i++)
    c[i]=a[i]+b[i];
}

With the 19991127 mainline, I get the following for the loop with
" -O1 -mieee -fPIC -fno-math-errno -mcpu=ev6":

$L6:
        s8addq $4,0,$1
        addq $1,$18,$3
        addq $1,$16,$2
        addq $1,$17,$1
        ldt $f11,0($2)
        ldt $f10,0($1)
        addtsu $f11,$f10,$f12
        fmov $f12,$f10       <= what is this for?
        stt $f10,0($3)
        addl $4,1,$4
        cmplt $4,$19,$1
        bne $1,$L6

with -O2 instead, I get

$L6:
        ldt $f12,0($16)
        lda $16,8($16)
        ldt $f11,0($17)
        lda $17,8($17)
        addl $2,1,$2
        cmplt $2,$19,$1
        addtsu $f12,$f11,$f10
        stt $f10,0($18)
        lda $18,8($18)
        bne $1,$L6

which is very nice, but I get boatloads of fmov's with -O2 in just a
bit more complicated code.

Richard Henderson suggested once that the register allocation problems
with -mieee on the ev6 are due to all the early clobbers on the
destination registers of floating-point instructions, and, indeed,
that fmov shows up in the rtl dumps first in testfloat.c.13.greg.
But I'll be damned if I can figure out how it got there.
Can anyone help me out? Or, better yet, get rid of it?

Brad Lucier

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