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
-
-
yes an LLVM bug is filed about the case where you make a pointer (on a 32-bit machine) and try to guess it in a loop and it thinks you can't
-
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 -
-
-
Maybe the valid transform is just that LLVM can assume either the int is a hw address that can't overlap with something usable by malloc...
-
if you turn off ASLR you can actually guess the address though :)
-
A transformation that (effectively, as-if principle) changes the address malloc returns seems perfectly valid.
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.