Print a meaningful message when a misaligned (compile-time) constant address is used.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
We generally prefer not to emit diagnostics for undefined behavior from the backend because the code might be dynamically unreachable (and the user might not be able to do anything about it if the code is unreachable because the compiler cloned the code).
Comment Actions
This issue was detected in a customer code and it was actually a bug in it. We've decided to go this route to make it easier for customers to see what the problem is (and this scenario is almost guaranteed to be a source code bug).
Comment Actions
As @efriedma points out that's weird compared to the rest of LLVM. It'll be dependent on optimization levels, and might occur in dynamically-unreachable code. Can you instead detect this and transform it to a trap?