ICPC 14 (Composer XE 2013 SP1) error when constructing a std::vector, using GCC 4.7 in C++11 mode

ICPC 14 (Composer XE 2013 SP1) error when constructing a std::vector, using GCC 4.7 in C++11 mode

I have recently installed the icpc 14, the newest version. I tried to use it in C++11 mode with GCC 4.7 (4.7.2 and 4.7.3 tested). A strange error when constructing std::vector happens. I managed to reduce it to the following minimal example,

#include <vector>

template <typename T>
class C
{
public :

void call ()
{
std::vector<double> data(100);
}
};

int main ()
{
C<double> c;
c.call();
}

When compiled with

icpc -std=c++11 -o test test.cpp # possible -gcc-name etc option to choose GCC versions

An error as the following is output,

/opt/gcc/include/c++/4.7.2/bits/stl_vector.h(904): internal error: bad pointer
emplace_back(_Args&&... __args);
^

compilation aborted for test.cpp (code 4)

If I just define such a vector in a free function, it is fine. If I remove the template, make the class C a simple class, it is fine. However, in the above example the error occurs with GCC 4.7.2 and GCC 4.7.3. I haven't got a chance to test with other GCC versions.

11 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

I see the same thing with g++-4.9, although g++ by itself succeeds.  Strangely, icpc dislikes the header file only when the c++-11 section is enabled.

With the previous release (13.1.192) it also is necessary to remove the c++11 option to make it pass.  There are many more errors under -std=c++-11.

Naming an a.out as test is generally dangerous, but that's not the problem here.  It's definitely a reportable bug, but I've been locked out of the bug reporting system for 3 weeks now.

This is simply to note that vector class is a fundamental in STL library and it is not clear how it could be related to the latest C++11 Standard. The only explanation could be It is the Bug in the compiler.

Quote:

Sergey Kostrov wrote:

This is simply to note that vector class is a fundamental in STL library and it is not clear how it could be related to the latest C++11 Standard. The only explanation could be It is the Bug in the compiler.

Surely it has something to do with C++11. If you look at the error message, it has something to do with rvalue reference. And the constructor in the minimal example is actually different in C++98 and C++11

>>...And the constructor in the minimal example is actually different in C++98 and C++11...

Yes, you're right. I did a quick verification with 3 versions of vector header files released in ~2005, ~2008, and ~2009 years, that is before 2011 (!), and the test case is working in all these 3 cases. I'll verify with a version of vector heade file released after 2011 as well.

This bug is being tracked in our bug database as DPD200247329. It was recently fixed and the fix will be in the next 14.0 update.
Here is a description of the bug. Sorry for the inconvenience.

9/9/13 [EDGcpfe/14410]
GNU C++ compatibility: Abort on declaration of variadic member template

A change made in version 4.7 (see EDGcpfe/13643 on 5/17/13) could result in
an abort (in update_parameter_pack_symbol_values) on the declaration of a
variadic member template in g++ mode when gnu_version >= 40700. Now fixed.

template class A;
template struct B {
B(const T1&);
template B(A);
};
template struct C {
void f() {
B b(0);
}
};
int main() {
C c;
c.f();
}

Is there any estimate for when this update will be release?
Is there a workaround by using some other C++11-enabled standard library?

I have just also hit this problem when using a std::multimap, this apparently can also trigger this bug indirectly.

Is there by now any estimate on when the fix will be released, or at least any workaround for the meantime?

I'm hitting this bug as well. It would be really nice to have an ETA for the fix or at least some kind of workaround.

 

This was fixed and should be in 14.0 update 1 (which should be available very soon since it passed product validation a few days ago).

Sorry for the inconvenience.

Judy

Hopefully icpc will now be fully compatible with g++ >= 4.7 headers in C++-11 mode, this is getting really tiring...

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen