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/15492] floating-point arguments are loaded too early to x87 stack


------- Additional Comments From uros at kss-loka dot si  2004-08-17 08:58 -------
A couple of other testcases (please note the number of fxch isns!):

double test1 (double a, int x, double b, int y, double c)
{
        return sin (c) + tan (b) * sqrt (a) + x * fabs (b) + y;
}

with 'gcc -ffast-math -fomit-frame-pointer':
test1:
        fldl    28(%esp)
        fsin
        fldl    16(%esp)
        fptan
        fstp    %st(0)
        fldl    4(%esp)
        fsqrt
        fmulp   %st, %st(1)
        faddp   %st, %st(1)
        fildl   12(%esp)
        fldl    16(%esp)
        fabs
        fmulp   %st, %st(1)
        faddp   %st, %st(1)
        fildl   24(%esp)
        faddp   %st, %st(1)
        ret

with 'gcc -O2 -ffast-math -fomit-frame-pointer':
test1:
        fldl    16(%esp)
        fldl    4(%esp)
        fld     %st(1)
        fptan
        fstp    %st(0)
        fldl    28(%esp)
        fxch    %st(3)
        fabs
        fxch    %st(2)
        fsqrt
        fxch    %st(3)
        fsin
        fxch    %st(1)
        fmulp   %st, %st(3)
        faddp   %st, %st(2)
        fildl   12(%esp)
        fmulp   %st, %st(1)
        faddp   %st, %st(1)
        fildl   24(%esp)
        faddp   %st, %st(1)
        ret

The shortest testcase could be:
double test1 (double y, double x)
{
        return atan2(x, y);
}

with 'gcc -ffast-math -fomit-frame-pointer':
test1:
        fldl    12(%esp)
        fldl    4(%esp)
        fpatan
        ret


with 'gcc -O2 -ffast-math -fomit-frame-pointer':
test1:
        fldl    4(%esp)
        fldl    12(%esp)
        fxch    %st(1)
        fpatan
        ret


-- 


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


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