Bug 1321399 - GCC, C++ template instantion failure
Summary: GCC, C++ template instantion failure
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gcc
Version: 7.4
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-26 09:02 UTC by Johnny
Modified: 2016-05-17 15:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-17 15:16:34 UTC
Target Upstream Version:


Attachments (Terms of Use)
The g++ preprocess output. (595.67 KB, text/x-csrc)
2016-03-26 09:02 UTC, Johnny
no flags Details

Description Johnny 2016-03-26 09:02:51 UTC
Created attachment 1140541 [details]
The g++ preprocess output.

Description of problem:
When compile a C++11 program, the G++ 4.8.2 failed at a template instantiation.

Helper.hpp: In instantiation of 'struct Caller<int (*)(int), std::tuple<MyAnyType&>&, std::tuple<int>&, 1ul>':
Helper.hpp:102:130:   required from 'auto Wrapper2(FuncT, Args& ...) [with FuncT = int (*)(int); Args = {MyAnyType}]'
speed.cpp:38:41:   required from here
Helper.hpp:73:8: internal compiler error: in gen_type_die_with_usage, at dwarf2out.c:19499
 struct Caller<FuncT, ParamTuple, CallTypes, 1> 
        ^
Please submit a full bug report,


Version-Release number of selected component (if applicable):
g++ 4.8.2

How reproducible:
g++ -g -std=c++11 -o speed speed.cpp Client.o 

Steps to Reproduce:
1.
2.
3.

Actual results:
Compile failure

Expected results:


Additional info:
Attached the preprocess file

Comment 2 Marek Polacek 2016-03-29 13:11:38 UTC
This was fixed in http://gcc.gnu.org/r198099 or in http://gcc.gnu.org/r198098.  The former doesn't seem to be backportable.

Comment 3 Marek Polacek 2016-03-29 13:19:10 UTC
Verified that this still fails with r198098.  In any case, this seems like ICE-on-invalid, thus I'm afraid low priority.

Comment 4 Johnny 2016-03-29 15:02:48 UTC
Hi Marek

Thanks for you prompt response.
Actually, when I remove the -g flag, the compilation works. So I doubt the corruption was caused by the debug symbol generation.

Any idea?

Regards,
Johnny

Comment 5 Jakub Jelinek 2016-05-17 14:40:53 UTC
> Actually, when I remove the -g flag, the compilation works. So I doubt the
> corruption was caused by the debug symbol generation.

That is of course a sing that it is very much related to debug info generation.

Anyway, you are trying to compile C++14 source by a compiler which has almost no C++14 support (and all it has is experimental), and use -std=c++11, the internal error is only during error recovery from this.  Better use a Developer Toolset compiler that has full C++14 support.

Comment 6 RHEL Program Management 2016-05-17 15:16:34 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.


Note You need to log in before you can comment on or make changes to this bug.