[Bug tree-optimization/106064] Wrong code comparing two global zero-sized arrays

rearnsha at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 27 14:18:15 GMT 2022


--- Comment #12 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to Alex Coplan from comment #11)
> (In reply to Jakub Jelinek from comment #8)
> > The IMHO UB case is for a != b when one address is at the start of one
> > object and the other address is at the end of another one
> Just to dig a little deeper on this, what makes this case UB? Is there
> something in the standard to this effect?

As stated in #6, zero-sized objects are a GNU extension.  I guess that means we
get to define what the behaviour should be :)

More information about the Gcc-bugs mailing list