Closed regehr closed 5 months ago
My two cents is that the memcmp'ing location is storing pointer bytes. Loading a pointer byte as an integer type (as tgt does) returns a poison value, that is the reason why the target is more poisonous, maybe.
My two cents is that the memcmp'ing location is storing pointer bytes. Loading a pointer byte as an integer type (as tgt does) returns a poison value, that is the reason why the target is more poisonous, maybe.
Yep, that's correct. I think the bug is in memcmp; the tgt return 0 in asm mode looks correct. memcmp may not be comparing pointer bytes correctly (should compare ptr addresses).
sigh... I looked at the memcmp implementation but spotting a subtle flaw in it is beyond me
I'm getting results that I did not expect from this code:
first, the result from alive-tv is that the LLVM middle end is committing a "Target is more poisonous than source" error when in fact the optimized code looks just fine, it's just loading two bytes, zexting them, and returning the difference. I can't make sense of the CEX, it seems to be saying that it's poison to load from index 0 of a memory block of size 1.
the second problem is that with
--tgt-is-asm
, Alive is giving a value mismatch herecc @tanmaytirpankar