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 c/13219] New: -fscse pessimizes double complex calculation


Using -fgcse pessimizes run time by 10% as compared to compiling without -fgcse.
The attached program provides a small example of
the problem.

Specifically, the line of code in question is:

    // "z" is a double complex.
    if ((creal(z) * creal(z) + cimag(z) * cimag(z)) >= 16.0)

Looking at the assembler files, the output for the above is:

with -O1:
	fld	%st(1)
	fmul	%st(2), %st
	fld	%st(1)
	fmul	%st(2), %st
	faddp	%st, %st(1)
	fucomp	%st(3)

with -O1 -fgcse:
	fld	%st(1)
	fld	%st(1)
	fxch	%st(3)
	fmul	%st(0), %st
	fxch	%st(2)
	fmul	%st(0), %st
	faddp	%st, %st(2)
	fxch	%st(1)
	fucomp	%st(3)

-- 
           Summary: -fscse pessimizes double complex calculation
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: coyote at coyotegulch dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux
  GCC host triplet: i686-pc-linux
GCC target triplet: i686-pc-linux


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


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