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

internal error: assertion failed at: "shared/cfe/edgcpfe/decl_inits.c", line 6224

Luke_D_
Beginner
332 Views
ldalessa:~/temp$ cat test.cpp 
#include <atomic>

struct Foo {
  Foo() : foo_() { }
  std::atomic<int> foo_[2];
};

int main() {
}
ldalessa:~/temp$ gcc --version
gcc (GCC) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ldalessa:~/temp$ gcc -std=c++11 test.cpp 
ldalessa:~/temp$ icpc --version
icpc (ICC) 15.0.4 20150805
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

ldalessa: ~/temp$ icpc -std=c++11 test.cpp
test.cpp(4): internal error: assertion failed at: "shared/cfe/edgcpfe/decl_inits.c", line 6224

    Foo() : foo_() { }
                ^

compilation aborted for test.cpp (code 4)

Current workaround is to skip the initializer for this member variable.

0 Kudos
3 Replies
Judith_W_Intel
Employee
332 Views

 

Thanks for your bug report. The problem still exists in our current compiler and I have submitted it as DPD200414465 in our bugs database. The problem can be reproduced in this small test case:

struct atomic
{
   atomic() = default;
};

struct C {
  C() : b() { }
  atomic b[2];
};

I think the constructor initializer (foo_()) in your code is unnecessary for atomics -- the default constructor for each member of the array will automatically be called since each field is default-initialized. So that might be a change (just remove it) that you could use as a workaround.

Judy

 

0 Kudos
Luke_D_
Beginner
332 Views

Yes, that's the workaround I'm currently using. It's mostly a documentation issue for us at the moment since the resulting code violates our enforced style without an explicit initializer for every field.

Thanks.

0 Kudos
Judith_W_Intel
Employee
332 Views

 

 I have a simple fix for this which I'm currently testing so it should be fixed in 17.0 update 1.

Good to hear you have an acceptable workaround in the meantime...

0 Kudos
Reply