https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67971

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-10-15
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
VRP jump-threads this into sth PRE then can transform to

  <bb 2>:
  if (cond_3(D) != 0)
    goto <bb 3>;
  else
    goto <bb 4>;

  <bb 3>:
  z1_5 = __builtin_cos (x_4(D));
  goto <bb 5>;

  <bb 4>:
  z1_7 = __builtin_cos (y_6(D));

  <bb 5>:
  # iftmp.0_2 = PHI <y_6(D)(4), x_4(D)(3)>
  # z1_13 = PHI <z1_7(4), z1_5(3)>
  # prephitmp_1 = PHI <z1_7(4), z1_5(3)>
  # RANGE [0, 1]
  _9 = prephitmp_1 == z1_13;
  # RANGE [0, 1] NONZERO 1
  _10 = (int) _9;
  return _10;

leaving the followup missed equivalency for the inserted PHI.

but then somehow DOM running later CSEing z1_13 and prephitmp_1 fails
to fold the comparison and we end up with

  _9 = z1_13 == z1_13;

which even forwprop doesn't simplify (even though it is supposed to fold
all stmts).  We do have

(simplify
 (eq @0 @0)
 (if (! FLOAT_TYPE_P (TREE_TYPE (@0))
      || ! HONOR_NANS (TYPE_MODE (TREE_TYPE (@0))))
  { constant_boolean_node (true, type); }))

but for some reason it doesn't trigger.

Investigating.

Reply via email to