[LLVMbugs] [Bug 990] NEW: codegen problem with 'complex' type on x86/linux

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Nov 7 16:29:37 PST 2006


           Summary: codegen problem with 'complex' type on x86/linux
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca

I've noticed a pattern in my testcase failures involving "csretcc". The bug
occurs with a simple testcase from the "cexp" man page:

// RUN: %llvmgcc -O2 -lm %s -o %s.exe
// RUN: ./%s.exe | grep "-1.000000+0.000000*i"
#include <stdio.h>

/* check that exp(i*pi) == -1 */
#include <math.h>   /* for atan */
#include <complex.h>
int main(void) {
  double pi = 4*atan(1);
  complex z = cexp(I*pi);
  printf("%f+%f*i\n", creal(z), cimag(z));

With LLVM, this produces:

$ llvm-gcc -O0 csretcc.c -lm -o csretcc
$ ./csretcc
Segmentation fault

while with GCC, it works:

$ gcc -O0 csretcc.c -lm -o csretcc
$ ./csretcc

In the bytecode, the call to "cexp" is called with "csretcc" calling convention.

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the llvm-bugs mailing list