Bug 1321399

Summary: GCC, C++ template instantion failure
Product: Red Hat Enterprise Linux 7 Reporter: Johnny <cajibi>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: qe-baseos-tools-bugs
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 7.4CC: mpolacek, ohudlick
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-17 15:16:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
The g++ preprocess output. none

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.