icc crash

icc crash


I get a crash when trying to compile a C/C++ program with icc

icc -O3 fail.cc
": internal error: ** segmentation violation signal raised **
Access violation or stack overflow. Please contact Support.

compilation aborted for fail.cc (code 4)


icc (ICC) 14.0.2 20140120
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

System: CentOS 6.5 Linux, 64 bit (kernel version: 2.6.32-431.5.1.el6.x86_64)

Attached the fail.cc file. The problem only occurs when both _may_i_use_cpu_feature and __cpuid are used together.

#include <stdlib.h>
#include <stdio.h>
#include <immintrin.h>

bool is_cpuid_ecx_bit_set(int eax, int bitidx)
  //int ecx = 0, edx = 0, ebx = 0;
  //__asm__ ("cpuid"
      //:"=b" (ebx),
      //"=c" (ecx),
      //"=d" (edx)
      //:"a" (eax)
  //return (((ecx >> bitidx)&1) == 1);
  int cpuinfo[4];
  int infotype = eax;
  __cpuid(cpuinfo, infotype);
  return (((cpuinfo[2] >> bitidx) & 1) == 1);

  int eax = 1;
  if(_may_i_use_cpu_feature(_FEATURE_AVX) > 0)
    if(is_cpuid_ecx_bit_set(eax, 28))
      printf("core true\n");
      printf("core false\n");
  return 0;




3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply


Thank you for reporting this bug, I have entered it in our internal bug tracking database (number


The crash is occurring in some compiler code that deals with restructuring of blocks so I think a workaround is to change the code so that the call to _may_i_use_cpu_feature is not inside a block, i.e.:


Change this:

  if(_may_i_use_cpu_feature(_FEATURE_AVX) > 0) {


  bool b = _may_i_use_cpu_feature(_FEATURE_AVX);
  if (b > 0) {

Sorry for the inconvenience.




Thanks - that worked.

Leave a Comment

Please sign in to add a comment. Not a member? Join today