------- Additional Comments From Thomas dot Koenig at online dot de  2005-02-28 
21:58 -------
(In reply to comment #11)
> For me I get:
>   D.1542 = COMPLEX_EXPR <REALPART_EXPR <b> / SR.4, IMAGPART_EXPR <b> / SR.4>;
>   D.1541 = D.1542;
>   D.1500 = D.1541;
>   return (double) REALPART_EXPR <D.1500> + (double) IMAGPART_EXPR <D.1500> < 
> 0.0;
> 
I cannot reproduce your result, no matter what compiler flags I try.
Which options exactly were you using to achieve this?

$ gcc -ffast-math -O3 -fdump-tree-optimized -fno-cx-limited-range -S  c-div.c
$ cat c-div.c.t65.optimized

;; Function main (main)

Analyzing Edge Insertions.
main ()
{
  float SR.34;
  float SR.33;
  float SR.32;
  float SR.31;
  float c$imag;
  float c$real;
  float SR.28;
  float SR.27;
  float SR.26;
  float SR.25;
  float D.3038;
  float D.3037;
  float D.3036;
  float D.3035;
  float D.3034;
  float D.3033;
  float D.3032;
  float D.3031;
  float D.3030;
  float D.3029;
  float D.3028;
  float D.3027;
  float D.3026;
  float D.3025;
  float D.3024;
  float D.3023;
  float D.3022;
  float D.3021;
  float D.3020;
  float D.3019;
  float D.3016;
  float D.3015;
  float D.3014;
  float D.3013;
  float D.3012;
  float D.3011;
  complex float c;
  complex float b;
  float a;
  double D.3008;
  double D.3007;
  float D.3006;
  double D.3005;
  float D.3004;
  complex float c.24;
  complex float c.23;
  int D.3001;
  complex float D.3000;
  complex float D.2999;
  float a.22;

<bb 0>:
  foo (&a, &b);
  SR.26 = a;
  D.3011 = REALPART_EXPR <b>;
  D.3012 = IMAGPART_EXPR <b>;
  if (ABS_EXPR <SR.26> < 0.0) goto <L1>; else goto <L2>;

<L1>:;
  D.3021 = SR.26 *  Inf;
  D.3022 = SR.26 * D.3021;
  c$real = (D.3012 + D.3011 * D.3021) / D.3022;
  c$imag = (D.3012 * D.3021 - D.3011) / D.3022;
  goto <bb 3>;

<L2>:;
  D.3030 = 0.0 / SR.26;
  c$real = (D.3011 + D.3012 * D.3030) / SR.26;
  c$imag = (D.3012 - D.3011 * D.3030) / SR.26;

<bb 3>:
  return (double) c$real + (double) c$imag < 0.0;

}


$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/ig25 --enable-languages=c,f95
Thread model: posix
gcc version 4.1.0 20050227 (experimental)
$ cat c-div.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;
}

$ gcc  -O3 -fdump-tree-optimized  -S  c-div.c
$ cat c-div.c.t65.optimized

;; Function main (main)

Analyzing Edge Insertions.
main ()
{
  float SR.30;
  float SR.29;
  float SR.28;
  float SR.27;
  float c$imag;
  float c$real;
  float SR.24;
  float SR.23;
  float SR.22;
  float SR.21;
  float D.2398;
  float D.2397;
  float D.2396;
  float D.2395;
  float D.2394;
  float D.2393;
  float D.2392;
  float D.2391;
  float D.2390;
  float D.2389;
  float D.2388;
  float D.2387;
  float D.2386;
  float D.2385;
  float D.2384;
  float D.2383;
  float D.2382;
  float D.2381;
  float D.2380;
  float D.2379;
  float D.2376;
  float D.2375;
  float D.2374;
  float D.2373;
  float D.2372;
  float D.2371;
  complex float c;
  complex float b;
  float a;
  double D.2368;
  double D.2367;
  float D.2366;
  double D.2365;
  float D.2364;
  complex float c.20;
  complex float c.19;
  int D.2361;
  complex float D.2360;
  complex float D.2359;
  float a.18;

<bb 0>:
  foo (&a, &b);
  SR.22 = a;
  D.2371 = REALPART_EXPR <b>;
  D.2372 = IMAGPART_EXPR <b>;
  if (ABS_EXPR <SR.22> < 0.0) goto <L1>; else goto <L2>;

<L1>:;
  D.2381 = SR.22 / 0.0;
  D.2383 = SR.22 * D.2381 + 0.0;
  c$real = (D.2372 + D.2371 * D.2381) / D.2383;
  c$imag = (D.2372 * D.2381 - D.2371) / D.2383;
  goto <bb 3>;

<L2>:;
  D.2390 = 0.0 / SR.22;
  D.2392 = SR.22 + D.2390 * 0.0;
  c$real = (D.2371 + D.2372 * D.2390) / D.2392;
  c$imag = (D.2372 - D.2371 * D.2390) / D.2392;

<bb 3>:
  return (double) c$real + (double) c$imag < 0.0;

}





-- 


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

Reply via email to