Neither the min-latency nor the max-throughput inline float divide set the 
Invalid Operation flag in the fpsr when calculating 0/0. 
 
$ cat divdf3.c 
#include <fenv.h> 
#include <stdio.h> 
#include <stdlib.h> 
 
double 
divdf3 (double a, double b) 
{ 
  return a / b; 
} 
 
int 
main (int argc, char **argv) 
{ 
  if (argc != 3) exit (1); 
  double a = atof (argv[1]); 
  double b = atof (argv[2]); 
  double c = divdf3 (a, b); 
  int e = fetestexcept (FE_INVALID); 
  printf ("%g / %g = %g, FE_INVALID %sset\n", a, b, c, e ? "" : "not "); 
} 
$ gcc divdf3.c -o divdf3 -lm 
$ ./divdf3 0 0 
0 / 0 = nan, FE_INVALID not set 
$ gcc -mno-inline-float-divide divdf3.c -o divdf3 -lm 
$ ./divdf3 0 0 
0 / 0 = nan, FE_INVALID set

-- 
           Summary: [4.0/4.1 regression] inline float divide does not set
                    correct fpu status flags
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schwab at suse dot de
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: ia64-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924

Reply via email to