here we try to guess the value of a pointer -- LLVM says we cannot guess it and GCC suspects we canhttps://godbolt.org/g/SFLwz4
If your guess involves any accesses, I think the bug is invalid; the compiler can infer UB from the access.
-
-
Does it still happen if &i == (int*)cur is changed to (uintptr_t)i == cur?
-
There may be an argument that using an invalid pointer as an operand to == invokes UB, but ops on uintptr_t are all 100% well-defined.
-
-
In that case they're probably both doing LOTS of wrong optimizations of stuff involving uintptr_t...
-
yes we have test cases that both GCC and LLVM break
End of conversation
New conversation -
-
But if you just try guessing by comparing for equality, esp after casting to uintptr_t, I think assuming no match is a clear bug.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.