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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #4)
> > or - 1 + !__x._M_node
> 
> Isn't that undefined for (x - y - 1 + !x) if x and y are both null?
> We get (T*)0 - 1 + 1 which overflows twice.

You're right, it would need to be + (!__x.M_node - 1).

> > or - !!__x._M_node
> 
> I think that's what I'll go with, thanks.

Reply via email to