Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

icc 17.0.0 miscompiles valid C code (compiled code hangs) at -O1 and above on x86_64-linux-gnu

$
0
0

Compiler version and platform: 

Intel(R) C Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.0.098 Build 20160721

$ icc -O0 small.c; ./a.out
$
$ icc -O1 small.c
$ timeout -s 9 10 ./a.out
Killed
$
$ gcc-6.2 -O0 small.c; ./a.out
$ clang-3.8 -O0 small.c; ./a.out
$
$ cat small.c
struct
{
  int f:1;
} volatile a;

int b = 1, c;

int main ()
{
  a.f = 1;
  while (!(b && a.f < c))
    ;
  return 0;
}
$

 


Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>