[Bug tree-optimization/95097] Missed optimization with bitfield value ranges

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed May 13 06:31:14 GMT 2020


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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Just to quote EVRP sees

  <bb 2> :
  _1 = VIEW_CONVERT_EXPR<unsigned int>(f);
  _2 = _1 & 1048575;
  if (_2 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  _3 = f.x;
  _4 = (unsigned int) _3;
  y_8 = _4 * 4096;
  if (y_8 <= 199)

thus the f.x != 0 test has been folded by one of those $?%&! permature
fold-const transforms to

  if ((BIT_FIELD_REF <f, 32, 0> & 1048575) != 0)

the fix is to get rid of those (and fix the "fallout").


More information about the Gcc-bugs mailing list