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
$
$ cat small.c
volatile int b = 1;
static int c;

short fn1 ()
{
  if (1)
    return b;
  return c;
}

int fn2 ()
{
  while (1)
    if (fn1 ())
      return 2;
}

int main ()
{
  fn2 ();
  return 0;
}
$

 


Viewing all articles
Browse latest Browse all 1175

Trending Articles