diff mbox

Fix PR debug/60433: Handle TEMPLATE_TYPE_PARM in dbxout_type

Message ID BLU436-SMTP156D5A7C2507877C92BDD297C00@phx.gbl
State New
Headers show

Commit Message

John David Anglin Sept. 7, 2014, 5:52 p.m. UTC
The attached change fixes an ICE in dbxout_type on hppa2.0w-hp- 
hpux11.11 compiling auto-fn24.C.

Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.

OK for trunk and 4.9?

Dave
--
John David Anglin	dave.anglin@bell.net
2014-09-07  John David Anglin  <danglin@gcc.gnu.org>

	PR debug/60433
	* dbxout.c (dbxout_type): Treat TEMPLATE_TYPE_PARM as a void type.

Comments

Jeff Law Sept. 11, 2014, 8:18 p.m. UTC | #1
On 09/07/14 11:52, John David Anglin wrote:
> The attached change fixes an ICE in dbxout_type on hppa2.0w-hp-hpux11.11
> compiling auto-fn24.C.
>
> Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.
>
> OK for trunk and 4.9?
Is dbxout.c allowed to look at language specific nodes?  Isn't 
TEMPLATE_TYPE_PARM defined by the C++ front-end .def file?

It's been eons since I looked at dbxout.c -- does it have hooks to deal 
with language specific nodes?

jeff
John David Anglin Sept. 11, 2014, 9:36 p.m. UTC | #2
On 9/11/2014 4:18 PM, Jeff Law wrote:
> On 09/07/14 11:52, John David Anglin wrote:
>> The attached change fixes an ICE in dbxout_type on hppa2.0w-hp-hpux11.11
>> compiling auto-fn24.C.
>>
>> Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.
>>
>> OK for trunk and 4.9?
> Is dbxout.c allowed to look at language specific nodes?  Isn't 
> TEMPLATE_TYPE_PARM defined by the C++ front-end .def file?
>
> It's been eons since I looked at dbxout.c -- does it have hooks to 
> deal with language specific nodes?

I don't have an answer to your questions but in dbxout_type_methods we 
skip TEMPLATE_DECLs.  I stuck
the TEMPLATE_TYPE_PARM with void type because of this.  It already 
includes LANG_TYPE.

Dave
Jeff Law Sept. 15, 2014, 10:08 p.m. UTC | #3
On 09/11/14 15:36, John David Anglin wrote:
> On 9/11/2014 4:18 PM, Jeff Law wrote:
>> On 09/07/14 11:52, John David Anglin wrote:
>>> The attached change fixes an ICE in dbxout_type on hppa2.0w-hp-hpux11.11
>>> compiling auto-fn24.C.
>>>
>>> Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.
>>>
>>> OK for trunk and 4.9?
>> Is dbxout.c allowed to look at language specific nodes?  Isn't
>> TEMPLATE_TYPE_PARM defined by the C++ front-end .def file?
>>
>> It's been eons since I looked at dbxout.c -- does it have hooks to
>> deal with language specific nodes?
>
> I don't have an answer to your questions but in dbxout_type_methods we
> skip TEMPLATE_DECLs.  I stuck
> the TEMPLATE_TYPE_PARM with void type because of this.  It already
> includes LANG_TYPE.
Yea, but the implementation around TEMPLATE_DECLs is to skip anything 
that isn't a FUNCTION_DECL.

I can't find anything in dbxout.c which references language specific 
nodes, so I'm hesitant to add them, even in something as rarely used as 
dbxout.c.

Can we take inspiration from dwarf2out.c here?

See is_ccx_auto and how it gets used in the type code.

jeff
diff mbox

Patch

Index: dbxout.c
===================================================================
--- dbxout.c	(revision 214357)
+++ dbxout.c	(working copy)
@@ -1946,6 +1946,7 @@ 
     case VOID_TYPE:
     case NULLPTR_TYPE:
     case LANG_TYPE:
+    case TEMPLATE_TYPE_PARM:
       /* For a void type, just define it as itself; i.e., "5=5".
 	 This makes us consider it defined
 	 without saying what it is.  The debugger will make it