Generated code currently uses floating-point division to implement
the ceiling and floor functions. This may lead to incorrect results
if -ffast-math is used (in conjuction w/ a -O level >0) to compile
such code.
Steps to reproduce:
w/ -ffast-math, (int) floor(((double)(41516))/((double)(107))) is 387
but 41516/107 = 388.
This patch replaces the current definitions with cloog's, which use
integer division only.
Generated code currently uses floating-point division to implement the ceiling and floor functions. This may lead to incorrect results if
-ffast-math
is used (in conjuction w/ a-O
level >0) to compile such code.Steps to reproduce:
w/
-ffast-math
,(int) floor(((double)(41516))/((double)(107)))
is 387 but 41516/107 = 388.This patch replaces the current definitions with cloog's, which use integer division only.