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 middle-end/19953] [4.0 regression] Special-case real + complex arithmetic operation


------- Additional Comments From Thomas dot Koenig at online dot de  2005-02-14 22:38 -------
For addition, this is a regression against 3.3.5:
$ cat c-add.c
#include <math.h>
#include <complex.h>

int main()
{
    float a;
    complex float b,c;
    foo(&a,&b);
    c = b+a;
    return creal(c) + cimag(c) < 0;
}
$ /usr/bin/gcc -S -O3 c-add.c
$ tail -20 c-add.s
        call    foo
        flds    -4(%ebp)
        flds    -8(%ebp)
        fxch    %st(1)
        fadds   .LC0
        fxch    %st(1)
        fadds   -12(%ebp)
        faddp   %st, %st(1)
        fldz
        fucompp
        fnstsw  %ax
        testb   $69, %ah
        sete    %dl
        movl    %ebp, %esp
        popl    %ebp
        movzbl  %dl, %eax
        ret
        .size   main, .-main
        .section        .note.GNU-stack,"",@progbits
        .ident  "GCC: (GNU) 3.3.5 (Debian 1:3.3.5-8)"

Note there's only one fldz there, for comparison (which is OK).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Special-case real + complex |[4.0 regression] Special-
                   |arithmetic operation        |case real + complex
                   |                            |arithmetic operation


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


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