https://bugs.llvm.org/show_bug.cgi?id=34530

            Bug ID: 34530
           Summary: Wrong results from floor() on arm
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: raj.k...@gmail.com
                CC: llvm-bugs@lists.llvm.org

This testcase

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void)
{
   double test = 526457263.914274;
   double test2 = 526457263.000000;

   printf("orig=%f floor=%f\n", test, floor(test));
   printf("orig=%f floor=%f\n", test2, floor(test2));

   return 0;
}

runtime results on arm are wrong when -On option is not used.

root@raspberrypi3:~# ./a.out 
orig=526457263.914274 floor=526457088.000052
orig=526457263.000000 floor=0.000000

if I compile it with -Os or -O2 then results are correct

root@raspberrypi3:~# ./a.out 
orig=526457263.914274 floor=526457263.000000
orig=526457263.000000 floor=526457263.000000


This is a regression starting 4.0, it works fine with 3.7

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to