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

            Bug ID: 19144
           Summary: Bad code generation at "-O0" and "double" values
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: PowerPC
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

The following test code fails when compiled with -O0.

#include <stdarg.h>
#include <stdio.h>
#include <string.h>

int x = 1;
int q = 1;
double y = 7.0;

double foo() {
  double d = x + y + q;
  return d;
}

int main(void) {

  double b = foo();
  if (b != 9.0) {
    printf("FAILED (result = %g but expect 9.0)\n", b);
  } else {
    printf("SUCCESS\n");
  }
}

If "double" is replaced with "float" it works.  -O1 and up have no problems.

-- 
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