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 tree-optimization/34099] [4.3 Regression] optimizer problem



------- Comment #3 from rguenth at gcc dot gnu dot org  2007-11-15 14:56 -------
Uhm, this goes wrong in CCP.  (w/o SRA the failure doesn't trigger though)

Before CCP we have:

void multiply(NumType, NumType, unsigned int, NumType&) (a, b, ac, ab)
{ 
  double s$_M_value$real;
  double s$_M_value$imag;
  double b$_M_value$real;
  double b$_M_value$imag;
  double a$_M_value$imag;
  double a$_M_value$real;
  complex double __t;
  complex double D.26933;
  complex double D.26932;
  double D.26931;
  double D.26929;
  unsigned int j;

<bb 2>:
  # VUSE <SFT.90_33(D)>
  a$_M_value$real_21 = REALPART_EXPR <a._M_value>;
  # VUSE <SFT.91_34(D)>
  a$_M_value$imag_22 = IMAGPART_EXPR <a._M_value>;
  # VUSE <SFT.93_35(D)>
  b$_M_value$imag_23 = IMAGPART_EXPR <b._M_value>;
  # VUSE <SFT.92_36(D)>
  b$_M_value$real_24 = REALPART_EXPR <b._M_value>;
  s$_M_value$real_25 = 0.0;
  s$_M_value$imag_26 = 0.0;
  goto <bb 4>;

<bb 3>:
  D.26929_10 = IMAGPART_EXPR <__t_6(D)>;
  __t_11 = COMPLEX_EXPR <b$_M_value$real_24, D.26929_10>;
  D.26931_13 = REALPART_EXPR <__t_11>;
  __t_14 = COMPLEX_EXPR <D.26931_13, b$_M_value$imag_23>;
  D.26932_15 = COMPLEX_EXPR <a$_M_value$real_21, a$_M_value$imag_22>;
  D.26933_16 = __t_14 * D.26932_15;
  s$_M_value$imag_17 = IMAGPART_EXPR <D.26933_16>;
  s$_M_value$real_18 = REALPART_EXPR <D.26933_16>;
  j_4 = j_1 + 1;

<bb 4>:
  # s$_M_value$real_20 = PHI <s$_M_value$real_25(2), s$_M_value$real_18(3)>
  # s$_M_value$imag_19 = PHI <s$_M_value$imag_26(2), s$_M_value$imag_17(3)>
  # j_1 = PHI <0(2), j_4(3)>
  if (j_1 < ac_3(D))
    goto <bb 3>;
  else
    goto <bb 5>;

<bb 5>:
  # SMT.98_38 = VDEF <SMT.98_37(D)>
  IMAGPART_EXPR <ab_5(D)->_M_value> = s$_M_value$imag_19;
  # SMT.98_39 = VDEF <SMT.98_38>
  REALPART_EXPR <ab_5(D)->_M_value> = s$_M_value$real_20;
  return;

} 

where I can see nothing wrong.  Now CCP propagates s$_M_value$real_25 and
s$_M_value$imag_26 into the PHI nodes, but somehow does not simulate BB3:

Visiting PHI node: s$_M_value$real_20 = PHI <s$_M_value$real_25(2),
s$_M_value$real_18(3)>
    Argument #0 (2 -> 4 executable)
        s$_M_value$real_25      Value: CONSTANT 0.0

    Argument #1 (3 -> 4 executable)
        s$_M_value$real_18      Value: UNDEFINED

    PHI node value: CONSTANT 0.0


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at google dot com


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


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