Anyone want to guess what gcc generates for a==b?0:a-b ? Any ideas why?
-
-
Even more surprisingly, gcc fails to collapse the branch out of this: ptrdiff_t diff(char *a, char *b) { return a!=b ? a-b : (intptr_t)a-(intptr_t)b; } clang gets it right, though.
Show this thread -
Oh, fun. gcc <= 7 gets it right too. Only gcc 8 fails to collapse it. I wonder if this is new logic to prevent wrongly applying "pointer provenance" stuff to pointers cast to integers.
Show this thread
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.