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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-06-22
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

Also on the GIMPLE level we have

  <bb 2> [local count: 1073741824]:
  # RANGE [irange] __int128 unsigned [0, 0][4294967296, +INF] NONZERO
0xffffffffffffffffffffffff00000000
  _1 = a_2(D) << 32;
  __a_4 = _1 | b_3(D);
  _5 = (int) __a_4;

the lowpart cast (int) __a_4 can be simplified to (int) b_3(D) based on
the range info of _1.  For example via

(simplify
 (convert (ior:c with_possible_nonzero_bits@0 @1))
 (if ( ... @0 has all zeros in lower TYPE_PRECSION (type) bits ...)
  (convert @1)))

I suppose a variant with b & (a << 32) is already optimized (to zero)?

Reply via email to