You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function creates two stack allocations with disjoint lifetimes and returns the pointers of those allocations cast to integers, as well as the result of comparing those pointers for equality. After optimization, the comparison is folded to false:
I don't think it's the same issue at all - that one is about pointer replacement under a dominating icmp, this one is about replacing icmps with incorrect values. I can reproduce this issue too by casting the pointers to integers first. Now you have two numerically equal integers that icmp says are not the same.
that one is about pointer replacement under a dominating icmp, this one is about replacing icmps with incorrect values
I think the problem mentioned by #45725 is actually the same as this one. The semantics of memory allocation "alloca" are inconsistent with lifetime intrinsics. See #45725 (comment).
Upstream issue: rust-lang/rust#107975 .
Godbolt.
This function creates two stack allocations with disjoint lifetimes and returns the pointers of those allocations cast to integers, as well as the result of comparing those pointers for equality. After optimization, the comparison is folded to false:
However, the addresses of these pointers may be equal. This reproduces as an end-to-end miscompilation in Rust.
The text was updated successfully, but these errors were encountered: