LLVM backend TBAA is too aggressive
At https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM/Alias\#HowtoTrackTBAAinformation there is written
It [a memory load/store] is very rarely of the form:
x = Sp + 8 I64[x] = ...
And when it is, 'it is' (unconfirmed) always deriving a "heap" pointer, "stack" pointers are always of the in-line variety.
In fact commit e10589a5 treats any memory access through a Cmm local variable as having the "other" type, which cannot alias any non-"other" address.
But it turns out that a Cmm local might be either an offset from Sp (#9125 (closed), though TBAA doesn't seem to have been the cause of the bad code there) or an offset from a Cmm global variable (#9308 (closed)). In general, we don't know anything about what it might be so we should conservatively use the "top" "type".
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (LLVM) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |