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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #4)
> (In reply to Jakub Jelinek from comment #3)
> > Other options perhaps could be - (__x._M_node ? 1 : 0)
> 
> That produces worse code (with a jump) at -O1

Oops, no it doesn't, I testsed this intead:

(__x._M_node ? __x._M_node - __y._M_node - 1 : 0)

And that has a jump, because the compiler doesn't know that __x._M_node being
null implies __y._M_node is null too (because the standard says it's undefined
otherwise).

Reply via email to