Patchwork [C,family] Fix pp_c_type_specifier IDENTIFIER_NODE handling

login
register
mail settings
Submitter Richard Guenther
Date June 9, 2011, 1:16 p.m.
Message ID <alpine.LNX.2.00.1106091514020.810@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/99745/
State New
Headers show

Comments

Richard Guenther - June 9, 2011, 1:16 p.m.
The current IDENTIFIER_NODE handling in pp_c_type_specifier can't work
because the first thing pp_c_tree_decl_identifier does is assert
that the passed tree is a DECL.  Instead the following patch arranges
us to use pp_c_identifier to dump an IDENTIFIER_NODE.

This (obvious?) patch is required to give a name to sizetype in
the middle-end.

I'll bootstrap/test it with some other changes, the gcc.dg testsuite
is now clean with sizetype having a IDENTIFIER_NODE TYPE_NAME.

Ok for trunk?

Thanks,
Richard.

2011-06-09  Richard Guenther  <rguenther@suse.de>

	c-family/
	* c-pretty-print.c (pp_c_type_specifier): Use pp_c_identifier
	to print a IDENTIFIER_NODE.
Joseph S. Myers - June 9, 2011, 2:07 p.m.
On Thu, 9 Jun 2011, Richard Guenther wrote:

> 2011-06-09  Richard Guenther  <rguenther@suse.de>
> 
> 	c-family/
> 	* c-pretty-print.c (pp_c_type_specifier): Use pp_c_identifier
> 	to print a IDENTIFIER_NODE.

OK.

Patch

Index: gcc/c-family/c-pretty-print.c
===================================================================
--- gcc/c-family/c-pretty-print.c	(revision 174841)
+++ gcc/c-family/c-pretty-print.c	(working copy)
@@ -345,7 +345,7 @@  pp_c_type_specifier (c_pretty_printer *p
       break;
 
     case IDENTIFIER_NODE:
-      pp_c_tree_decl_identifier (pp, t);
+      pp_c_identifier (pp, IDENTIFIER_POINTER (t));
       break;
 
     case VOID_TYPE: