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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |16.0
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2023-08-20 00:00:00         |2026-1-28
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Latest comments still hold.  early inlining still introduces
__builtin_unreachable off the else path of
if (__builtin_constant_p(p) && (p & 31) == 0), but does not elide
the checks.

CCP will elide the alignment check (it's given), but not the
__builtin_constant_p one.

Nothing will consider

  p_2 = (long unsigned int) &_rl2c_cmd_id_data;
  _3 = __builtin_constant_p (p_2);

as constant, but somehow IPA predicate analysis does:

    size:2.000000, time:2.000000,  executed if:(op0 not constant || op0,((long
unsigned int) #),(# & 31) != 0),  nonconst if:(op1 changed) && (op0 not
constant || op0,((long unsigned int) #),(# & 31) != 0)

it somehow elides the nop-conversion, but later folding does not.

A possible solution might be to fold a nop or widening conversion away
for __builtin_constant_p arguments.
  • [Bug ipa/111036] [13/14/15/16 R... rguenth at gcc dot gnu.org via Gcc-bugs

Reply via email to