Hi, I'm trying to compile and run the following code-snippet: implementation uint %fie(uint* %x) { %e = getelementptr uint* %x, int 1 ; %f = load uint* %e ret uint 3 } int %main(int %argc, sbyte** %argv) { %z = malloc uint, uint 10 %g = call uint %fie(uint* %z) ret int 0 } But the getelementptr instruction gives a segmentation fault. Have I misunderstood its use? I get segmentation faults when I try to compile it as well. bash-2.05b$ llvm-as -f test.ll bash-2.05b$ lli test.bc Segmentation fault bash-2.05b$ llc -f test.bc Segmentation fault Any ideas of what's wrong? , Tobias
Hi Tobias, I tried your test program on the latest CVS code. Everything worked fine. Can you tell me which version of LLVM you're using? Reid. On Sat, 2004-06-12 at 08:26, Tobias Nurmiranta wrote:> Hi, > > I'm trying to compile and run the following code-snippet: > > implementation > > uint %fie(uint* %x) { > %e = getelementptr uint* %x, int 1 > ; %f = load uint* %e > ret uint 3 > } > > int %main(int %argc, sbyte** %argv) { > %z = malloc uint, uint 10 > %g = call uint %fie(uint* %z) > ret int 0 > } > > But the getelementptr instruction gives a segmentation fault. Have I > misunderstood its use? I get segmentation faults when I try to compile it > as well. > > bash-2.05b$ llvm-as -f test.ll > bash-2.05b$ lli test.bc > Segmentation fault > bash-2.05b$ llc -f test.bc > Segmentation fault > > Any ideas of what's wrong? > , Tobias > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040612/e97731ee/attachment.sig>
Hi! Hmm, ok. I'm using the 1.2 release. Found out that it worked when using long to index getelementptr, but not when using uint, int or ulong. But then I'll try with the CVS code instead. Thank you. , Tobias On Sat, 12 Jun 2004, Reid Spencer wrote:> Hi Tobias, > > I tried your test program on the latest CVS code. Everything worked > fine. > > Can you tell me which version of LLVM you're using? > > Reid. > > On Sat, 2004-06-12 at 08:26, Tobias Nurmiranta wrote: > > Hi, > > > > I'm trying to compile and run the following code-snippet: > > > > implementation > > > > uint %fie(uint* %x) { > > %e = getelementptr uint* %x, int 1 > > ; %f = load uint* %e > > ret uint 3 > > } > > > > int %main(int %argc, sbyte** %argv) { > > %z = malloc uint, uint 10 > > %g = call uint %fie(uint* %z) > > ret int 0 > > } > > > > But the getelementptr instruction gives a segmentation fault. Have I > > misunderstood its use? I get segmentation faults when I try to compile it > > as well. > > > > bash-2.05b$ llvm-as -f test.ll > > bash-2.05b$ lli test.bc > > Segmentation fault > > bash-2.05b$ llc -f test.bc > > Segmentation fault > > > > Any ideas of what's wrong? > > , Tobias > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev >