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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
It works with -mavx or when 'foo' is early inlined (using always-inline).

Working:

  u.1_8 = u;
  _9 = (long long unsigned int) u.1_8;
  u64_0_10 = _9 | 23725760132;
  _18 = u64_0_10 * 3095179400;
  _50 = _18 == 0;
  _53 = (__int128) _50;
  _54 = -_53;
  _58 = (__int128) _50;
  _59 = -_58;
  D.2295.a = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  _69 = BIT_FIELD_REF <D.2295.b[0], 128, 128>;
  _66 = BIT_FIELD_REF <D.2295.b[0], 128, 0>;
  _67 = VIEW_CONVERT_EXPR<vector(4) unsigned int>(_54);
  _68 = _66 + _67;
  _70 = VIEW_CONVERT_EXPR<vector(4) unsigned int>(_59);
  _71 = _69 + _70;
  v256u8_r_26 = {_68, _71};
  x = v256u8_r_26;

not working:

  u.1_27 = u;
  _28 = (long long unsigned int) u.1_27;
  u64_0_29 = _28 | 23725760132;
  _38 = u64_0_29 * 3095179400;
  _56 = _38 == 0;
  _59 = (__int128) _56;
  _60 = -_59;
  D.2034.a = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  _70 = BIT_FIELD_REF <D.2034.b[0], 128, 128>;
  _67 = BIT_FIELD_REF <D.2034.b[0], 128, 0>;
  _69 = _67 + { 4294967295, 4294967295, 4294967295, 4294967295 };
  _71 = VIEW_CONVERT_EXPR<vector(4) unsigned int>(_60);
  _72 = _70 + _71;
  BIT_FIELD_REF <x, 128, 0> = _69;
  BIT_FIELD_REF <x, 128, 128> = _72;

and CCP produces the bogus constant folded vector from

  _38 = u64_0_29 * 3095179400;
  _1 = (<signed-boolean:128>) _38;
  _50 = _1 ^ 1;
  _53 = _50 & 1;
  _54 = (__int128) _53;
  _55 = -_54;
  _68 = VIEW_CONVERT_EXPR<vector(4) unsigned int>(_55);
  _69 = _68 + _67;

but it's interpretations are OK I think.  It must go wrong in veclower somehow,
the broken version ends up with a compare in signed-bool while the working
one uses an __int128 compare.

Reply via email to