Hi guys, I'm new to LLVM and trying demo with the following C code: int main() { int a = 65535; *(1+(char *)a) = 0; return a; } unfortunately it generates the wrong IR: define i32 @main() nounwind { entry: store i8 0, i8* inttoptr (i64 65536 to i8*), align 65536 ret i32 65535 } seems SSA not applied on memory but incorrectly 'acrossed' by scalar values. Is it a bug? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100508/7bb8dfac/attachment.html>
Did you mean (char*)&a ? On Sat, May 8, 2010 at 2:21 PM, Rebel Lion <r3831110n at gmail.com> wrote:> Hi guys, I'm new to LLVM and trying demo with the following C code: > int main() > { > int a = 65535; > *(1+(char *)a) = 0; > return a; > } > unfortunately it generates the wrong IR: > define i32 @main() nounwind { > entry: > store i8 0, i8* inttoptr (i64 65536 to i8*), align 65536 > ret i32 65535 > } > seems SSA not applied on memory but incorrectly 'acrossed' by scalar values. > Is it a bug? > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Seemingly Similar Threads
- Optimization issues (Alias Analysis?)
- [LLVMdev] Alias analysis issue with structs on PPC
- [LLVMdev] Alias analysis issue with structs on PPC
- [LLVMdev] BasicAliasAnalysis: constant does not alias with noalias parameter
- [LLVMdev] BasicAliasAnalysis: constant does not alias with noalias parameter