David Lurton via llvm-dev
2017-Jul-23 01:45 UTC
[llvm-dev] Can someone take a quick look at this?
What am I not seeing? Any idea why @initModule is returning a random value as if from uninitialized memory? ; ModuleID = 'test_4' source_filename = "test_4" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @foo = global i32 0, align 4 @bar = external global float, align 4 define i32 @initModule() { EntryBlock: store i32 123, i32* @foo, align 4 %0 = load i32, i32* @foo, align 4 ret i32 %0 } If the answer is not obvious I'll work on creating a minimal reproduction case... I was just hoping that someone else could see something obvious that I'm missing. Thanks. -David -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170722/c47815ba/attachment.html>
Tim Northover via llvm-dev
2017-Jul-23 02:15 UTC
[llvm-dev] Can someone take a quick look at this?
On 22 July 2017 at 18:45, David Lurton via llvm-dev <llvm-dev at lists.llvm.org> wrote:> If the answer is not obvious I'll work on creating a minimal reproduction > case... I was just hoping that someone else could see something obvious > that I'm missing.I can't see anything wrong with this fragment. I'd be looking hard at the caller (a JIT, perhaps?) and where it expects the value to be returned because there aren't many other ways to get a simple module like that wrong without crashing. Cheers. Tim.