$ cat complex-parts.c #include <math.h> #include <complex.h> int main() { float cr,ci; float complex c; foo(&cr,&ci); c = cr+I*ci; return creal(c)+cimag(c)<0; } $ gcc -S -O2 -fdump-tree-optimized complex-parts.c $ tail -10 complex-parts.c.t66.optimized float D.2359; float cr.18;
<bb 0>: foo (&cr, &ci); return (double) (cr + 0.0) + (double) (ci + 0.0) < 0.0; } $ gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.1/configure --prefix=/home/ig25 --enable-languages=c,f95 Thread model: posix gcc version 4.1.0 20050311 (experimental) -- Summary: pessimization of complex expression Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Thomas dot Koenig at online dot de CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20434