Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7942 Discussions

icc 17.0.1 miscompiles valid C code (compiled code segfaults) at -Os and above on x86_64-linux-gnu

Zhendong_Su
Beginner
326 Views

Compiler version and platform: 

Intel(R) C Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.132 Build 20161005 

$ cat small.c
struct
{
  int f0:24;
  volatile int f1;
} a = {-8, 0}, c[1];

volatile int b, g, i = -8;
int d, h;
unsigned int e;

int main ()
{
  if (!(d < 1 && a.f0 > b))
    g = a.f0;
  a.f0 = a.f0 && h;
  e = g - 5;
  b = i % e; 
  if (b < d)
    c[120].f1;
  if (h)
    while (1)
      ;
  return 0; 
}
$ 

 

0 Kudos
0 Replies
Reply