Community
cancel
Showing results for 
Search instead for 
Did you mean: 
vinc17
Beginner
102 Views

icx 2021.2.0 bug: incorrect NaN comparison using an identifier with external linkage

Consider the following code:

#include <stdio.h>

double c = 0.0 / 0.0;
static double d = 0.0 / 0.0;

int main (void)
{
  double e = 0.0 / 0.0;
  printf ("%d %.17g\n", c != c, c);
  printf ("%d %.17g\n", d != d, d);
  printf ("%d %.17g\n", e != e, e);
  return 0;
}

With Intel(R) oneAPI DPC++ Compiler 2021.2.0 (2021.2.0.20210317), using the "icx" command, I get the following incorrect output:

0 nan
1 nan
1 nan

i.e. with 0 instead of 1 for the identifier with external linkage (variable c). No such issue with the "clang" command (still from oneAPI 2021.2):

1 nan
1 nan
1 nan

 

0 Kudos
3 Replies
vinc17
Beginner
89 Views

There are also 8 MPFR tests failing apparently due to NaN returned by the library functions (this was actually how I detected the issue with NaN). But I'm not sure about the exact reason.

NoorjahanSk_Intel
Moderator
64 Views

Hi,

Thanks for reaching out to us.

We are looking into this issue internally. we will get back to you soon.

Thanks & Regards

Noorjahan


Viet_H_Intel
Moderator
46 Views

I've reported this issue to our Compiler Developer.

Thanks for the test case.


Reply