http://llvm.org/bugs/show_bug.cgi?id=2818

           Summary: Segmentation fault on PPC64 generated code
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [email protected]


Created an attachment (id=2032)
 --> (http://llvm.org/bugs/attachment.cgi?id=2032)
LLVM .ll

I tried to compile the following code using llvm-gcc 2.3 and it compiles right,
but the PPC64 generated code (from llc) crashs with segfault.

==
sum.c
==

int SumOrig_sum_ARI_I (int* A) {
        A[8] = 42;
        A[9876] = 876;
        return A[0]+A[1]+1;
}

I used the following main function to test this:

==
main.c
===
int main (void) {

 int a[1000000];
 a[0] = 10;
 a[1] = 20;

 printf("%d\n", SumOrig_sum_ARI_I(a));
 printf("%d\n", a[9876]);

 return 0;
}

On x86 the result is right:

[EMAIL PROTECTED]:~$ ./main 
31
876

Follow attached LLVM .ll and the PPC64 code ( llc -march=ppc64 -mcpu=ppc64) and
just for comparison the GCC code for the same function.

The crash was on a PPC64 running Fedora 9.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to