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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Krister Walfridsson from comment #3)
> The C program is obviously UB. But the optimization is done on GIMPLE, and
> it is not obvious to me that the GIMPLE code is UB -- we have a function
> called __builtin_clz that calls an internal function, so they are
> different...

Not exactly. GCC does not distinguish between __builtin_* the builtin vs an
user function really.  

You mention "internal call" but __builtin_clz is not an `internal call` but
rather a call to a function decl called __builtin_clz where the decl is a
builtin call.

That is the call to __builtin_clz is the same decl as the function being
defined.

There is no undefinedness in the range here since they are exactly the same.

Reply via email to