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/85375] possible missed optimisation / regression from 6.3 with while (__builtin_ffs(x) && x)


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-04-12
             Blocks|                            |85316
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
.optimized shows

  <bb 2> [local count: 114863532]:
  _8 = __builtin_ffs (x_4(D));
  if (_8 != 0)
    goto <bb 3>; [94.50%]
  else
    goto <bb 7>; [5.50%]

  <bb 3> [local count: 108546038]:
  if (x_4(D) != 0)
    goto <bb 4>; [94.50%]
  else
    goto <bb 7>; [5.50%]

missed jump-threading.

  <bb 5> [local count: 958878293]:
  # x_10 = PHI <x_4(D)(4), x_6(6)>
  x_6 = x_10 - a.0_1;
  _2 = __builtin_ffs (x_6);
  if (_2 != 0)
    goto <bb 6>; [94.50%]
  else
    goto <bb 7>; [5.50%]

  <bb 6> [local count: 906139986]:
  if (x_6 != 0)
    goto <bb 5>; [94.50%]
  else
    goto <bb 7>; [5.50%]

likewise.  VRP needs to derive a range for x_6 from _2 != 0.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85316
[Bug 85316] [meta-bug] VRP range propagation missed cases

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