[LLVMdev] getelementptr results in seg-fault.

Tobias Nurmiranta spyck at lysator.liu.se
Sat Jun 12 10:31:00 PDT 2004


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




More information about the llvm-dev mailing list