This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Identifiers charset conversion cleanup for gcc/config/


Continuing cleaning up identifiers handling in the compiler in
preparation for extended identifiers, this patch deals with
identifiers in target-dependent files in config/, making diagnostics
using identifiers use %qE rather than %qs (or, in several places, the
old-style `%s').

As I noted for the patch for language and target independent files
<http://gcc.gnu.org/ml/gcc-patches/2009-05/msg00145.html>, in some
cases extended identifiers can't in fact appear but it still seems
clearest to reduce the number of direct IDENTIFIER_POINTER calls and
use %E where possible for identifiers instead of %s; this will also
facilitate subsequent checks for any cases missed in this patch
series.  In fact most cases here are for attributes that are
registered by the targets and so can't be extended identifiers, but
some are not.

The previous patch in this series
<http://gcc.gnu.org/ml/gcc-patches/2009-05/msg00198.html>, fixing C++
and ObjC, is still pending review; that patch and this one are
independent.

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  I have
also tested building cc1 for a cross to each of the following targets,
checking the warnings for building the $cpu.o file or other
target-specific .o file to make sure none are introduced by this
patch:

arc-elf
arm-eabi
avr-elf
bfin-elf
i686-darwin8
h8300-elf
i686-mingw32
ia64-elf
m32c-elf
m68hc11-elf
m68k-elf
mcore-elf
mips-elf
powerpc-eabi
sh-symbianelf
spu-elf
xstormy16-elf
v850-elf

OK to commit?

2009-05-09  Joseph Myers  <joseph@codesourcery.com>

	* config/arc/arc.c (arc_handle_interrupt_attribute): Use %qE for
	identifiers in diagnostics.
	* config/arm/arm.c (arm_handle_fndecl_attribute,
	arm_handle_isr_attribute): Likewise.
	* config/avr/avr.c (avr_handle_progmem_attribute,
	avr_handle_fndecl_attribute, avr_handle_fntype_attribute):
	Likewise.
	* config/bfin/bfin.c (handle_int_attribute,
	bfin_handle_longcall_attribute, bfin_handle_l1_text_attribute,
	bfin_handle_l1_data_attribute, bfin_handle_longcall_attribute,
	bfin_handle_l1_text_attribute, bfin_handle_l1_data_attribute):
	Likewise.
	* config/darwin.c (darwin_handle_kext_attribute,
	darwin_handle_weak_import_attribute): Likewise.
	* config/h8300/h8300.c (h8300_handle_fndecl_attribute,
	h8300_handle_eightbit_data_attribute,
	h8300_handle_tiny_data_attribute): Likewise.
	* config/i386/i386.c (ix86_handle_cconv_attribute,
	ix86_handle_abi_attribute, ix86_handle_struct_attribute):
	Likewise.
	* config/i386/winnt.c (ix86_handle_shared_attribute,
	ix86_handle_selectany_attribute): Likewise.
	* config/ia64/ia64.c (ia64_handle_model_attribute): Likewise.
	* config/m32c/m32c.c (function_vector_handler): Likewise.
	* config/m68hc11/m68hc11.c (m68hc11_handle_page0_attribute,
	m68hc11_handle_fntype_attribute): Likewise.
	* config/m68k/m68k.c (m68k_handle_fndecl_attribute): Likewise.
	* config/mcore/mcore.c (mcore_handle_naked_attribute): Likewise.
	* config/mips/mips.c (mips_insert_attributes,
	mips_merge_decl_attributes, mips_expand_builtin): Likewise.
	* config/rs6000/rs6000.c (rs6000_handle_longcall_attribute,
	rs6000_handle_struct_attribute): Likewise.
	* config/sh/sh.c (sh_insert_attributes,
	sh_handle_resbank_handler_attribute,
	sh_handle_interrupt_handler_attribute,
	sh2a_handle_function_vector_handler_attribute,
	sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute):
	Likewise.
	* config/sh/symbian.c (sh_symbian_mark_dllimport): Likewise.
	* config/spu/spu.c (spu_handle_fndecl_attribute,
	spu_handle_vector_attribute): Likewise.
	* config/stormy16/stormy16.c
	(xstormy16_handle_interrupt_attribute): Likewise.
	* config/v850/v850-c.c (ghs_pragma_section): Likewise.
	* config/v850/v850.c (v850_handle_interrupt_attribute): Likewise.

Index: gcc/config/m32c/m32c.c
===================================================================
--- gcc/config/m32c/m32c.c	(revision 147317)
+++ gcc/config/m32c/m32c.c	(working copy)
@@ -1,5 +1,5 @@
 /* Target Code for R8C/M16C/M32C
-   Copyright (C) 2005, 2006, 2007, 2008
+   Copyright (C) 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
    Contributed by Red Hat.
 
@@ -2781,24 +2781,24 @@ function_vector_handler (tree * node ATT
     {
       /* The attribute is not supported for R8C target.  */
       warning (OPT_Wattributes,
-                "`%s' attribute is not supported for R8C target",
-                IDENTIFIER_POINTER (name));
+                "%qE attribute is not supported for R8C target",
+                name);
       *no_add_attrs = true;
     }
   else if (TREE_CODE (*node) != FUNCTION_DECL)
     {
       /* The attribute must be applied to functions only.  */
       warning (OPT_Wattributes,
-                "`%s' attribute applies only to functions",
-                IDENTIFIER_POINTER (name));
+                "%qE attribute applies only to functions",
+                name);
       *no_add_attrs = true;
     }
   else if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST)
     {
       /* The argument must be a constant integer.  */
       warning (OPT_Wattributes,
-                "`%s' attribute argument not an integer constant",
-                IDENTIFIER_POINTER (name));
+                "%qE attribute argument not an integer constant",
+                name);
       *no_add_attrs = true;
     }
   else if (TREE_INT_CST_LOW (TREE_VALUE (args)) < 18
@@ -2806,8 +2806,8 @@ function_vector_handler (tree * node ATT
     {
       /* The argument value must be between 18 to 255.  */
       warning (OPT_Wattributes,
-                "`%s' attribute argument should be between 18 to 255",
-                IDENTIFIER_POINTER (name));
+                "%qE attribute argument should be between 18 to 255",
+                name);
       *no_add_attrs = true;
     }
   return NULL_TREE;
Index: gcc/config/spu/spu.c
===================================================================
--- gcc/config/spu/spu.c	(revision 147317)
+++ gcc/config/spu/spu.c	(working copy)
@@ -3723,8 +3723,8 @@ spu_handle_fndecl_attribute (tree * node
 {
   if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (0, "`%s' attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (0, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -3781,7 +3781,7 @@ spu_handle_vector_attribute (tree * node
   *no_add_attrs = true;		/* No need to hang on to the attribute.  */
 
   if (!result)
-    warning (0, "`%s' attribute ignored", IDENTIFIER_POINTER (name));
+    warning (0, "%qE attribute ignored", name);
   else
     *node = lang_hooks.types.reconstruct_complex_type (*node, result);
 
Index: gcc/config/i386/winnt.c
===================================================================
--- gcc/config/i386/winnt.c	(revision 147317)
+++ gcc/config/i386/winnt.c	(working copy)
@@ -1,7 +1,7 @@
 /* Subroutines for insn-output.c for Windows NT.
    Contributed by Douglas Rupp (drupp@cs.washington.edu)
    Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -56,8 +56,8 @@ ix86_handle_shared_attribute (tree *node
 {
   if (TREE_CODE (*node) != VAR_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to variables",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to variables",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -78,8 +78,8 @@ ix86_handle_selectany_attribute (tree *n
      initialization later in encode_section_info.  */
   if (TREE_CODE (*node) != VAR_DECL || !TREE_PUBLIC (*node))
     {	
-      error ("%qs attribute applies only to initialized variables"
-       	     " with external linkage",  IDENTIFIER_POINTER (name));
+      error ("%qE attribute applies only to initialized variables"
+       	     " with external linkage", name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	(revision 147317)
+++ gcc/config/i386/i386.c	(working copy)
@@ -4245,8 +4245,8 @@ ix86_handle_cconv_attribute (tree *node,
       && TREE_CODE (*node) != FIELD_DECL
       && TREE_CODE (*node) != TYPE_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
       return NULL_TREE;
     }
@@ -4265,14 +4265,14 @@ ix86_handle_cconv_attribute (tree *node,
       if (TREE_CODE (cst) != INTEGER_CST)
 	{
 	  warning (OPT_Wattributes,
-		   "%qs attribute requires an integer constant argument",
-		   IDENTIFIER_POINTER (name));
+		   "%qE attribute requires an integer constant argument",
+		   name);
 	  *no_add_attrs = true;
 	}
       else if (compare_tree_int (cst, REGPARM_MAX) > 0)
 	{
-	  warning (OPT_Wattributes, "argument to %qs attribute larger than %d",
-		   IDENTIFIER_POINTER (name), REGPARM_MAX);
+	  warning (OPT_Wattributes, "argument to %qE attribute larger than %d",
+		   name, REGPARM_MAX);
 	  *no_add_attrs = true;
 	}
 
@@ -4283,8 +4283,8 @@ ix86_handle_cconv_attribute (tree *node,
     {
       /* Do not warn when emulating the MS ABI.  */
       if (TREE_CODE (*node) != FUNCTION_TYPE || ix86_function_type_abi (*node)!=MS_ABI)
-	warning (OPT_Wattributes, "%qs attribute ignored",
-	         IDENTIFIER_POINTER (name));
+	warning (OPT_Wattributes, "%qE attribute ignored",
+	         name);
       *no_add_attrs = true;
       return NULL_TREE;
     }
@@ -26836,15 +26836,15 @@ ix86_handle_abi_attribute (tree *node, t
       && TREE_CODE (*node) != FIELD_DECL
       && TREE_CODE (*node) != TYPE_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
       return NULL_TREE;
     }
   if (!TARGET_64BIT)
     {
-      warning (OPT_Wattributes, "%qs attribute only available for 64-bit",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only available for 64-bit",
+	       name);
       *no_add_attrs = true;
       return NULL_TREE;
     }
@@ -26891,8 +26891,8 @@ ix86_handle_struct_attribute (tree *node
   if (!(type && (TREE_CODE (*type) == RECORD_TYPE
 		 || TREE_CODE (*type) == UNION_TYPE)))
     {
-      warning (OPT_Wattributes, "%qs attribute ignored",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute ignored",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -26901,8 +26901,8 @@ ix86_handle_struct_attribute (tree *node
 	   || ((is_attribute_p ("gcc_struct", name)
 		&& lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type)))))
     {
-      warning (OPT_Wattributes, "%qs incompatible attribute ignored",
-               IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE incompatible attribute ignored",
+               name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/sh/symbian.c
===================================================================
--- gcc/config/sh/symbian.c	(revision 147317)
+++ gcc/config/sh/symbian.c	(working copy)
@@ -269,8 +269,8 @@ sh_symbian_mark_dllimport (tree decl)
 
   if (sh_symbian_dllexport_name_p (oldname))
     {
-      error ("%qs declared as both exported to and imported from a DLL",
-             IDENTIFIER_POINTER (DECL_NAME (decl)));
+      error ("%qE declared as both exported to and imported from a DLL",
+             DECL_NAME (decl));
     }
   else if (sh_symbian_dllimport_name_p (oldname))
     {
@@ -502,8 +502,8 @@ sh_symbian_handle_dll_attribute (tree *p
       && (   TREE_CODE (node) == VAR_DECL
 	  || TREE_CODE (node) == FUNCTION_DECL))
     {
-      error ("external linkage required for symbol %q+D because of %qs attribute",
-	     node, IDENTIFIER_POINTER (name));
+      error ("external linkage required for symbol %q+D because of %qE attribute",
+	     node, name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c	(revision 147317)
+++ gcc/config/sh/sh.c	(working copy)
@@ -8040,8 +8040,8 @@ sh_insert_attributes (tree node, tree *a
 		  || is_attribute_p ("nosave_low_regs", TREE_PURPOSE (attrs))
 		  || is_attribute_p ("resbank", TREE_PURPOSE (attrs)))
 		warning (OPT_Wattributes,
-			 "%qs attribute only applies to interrupt functions",
-			 IDENTIFIER_POINTER (TREE_PURPOSE (attrs)));
+			 "%qE attribute only applies to interrupt functions",
+			 TREE_PURPOSE (attrs));
 	      else
 		{
 		  *tail = tree_cons (TREE_PURPOSE (attrs), NULL_TREE,
@@ -8123,14 +8123,14 @@ sh_handle_resbank_handler_attribute (tre
 {
   if (!TARGET_SH2A)
     {
-      warning (OPT_Wattributes, "%qs attribute is supported only for SH2A",
-               IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute is supported only for SH2A",
+               name);
       *no_add_attrs = true;
     }
   if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-               IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+               name);
       *no_add_attrs = true;
     }
 
@@ -8147,8 +8147,8 @@ sh_handle_interrupt_handler_attribute (t
 {
   if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-               IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+               name);
       *no_add_attrs = true;
     }
   else if (TARGET_SHCOMPACT)
@@ -8170,30 +8170,30 @@ sh2a_handle_function_vector_handler_attr
 {
   if (!TARGET_SH2A)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to SH2A",
-               IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to SH2A",
+               name);
       *no_add_attrs = true;
     }
   else if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-               IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+               name);
       *no_add_attrs = true;
     }
   else if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST)
     {
       /* The argument must be a constant integer.  */
       warning (OPT_Wattributes,
-               "`%s' attribute argument not an integer constant",
-               IDENTIFIER_POINTER (name));
+               "%qE attribute argument not an integer constant",
+               name);
       *no_add_attrs = true;
     }
   else if (TREE_INT_CST_LOW (TREE_VALUE (args)) > 255)
     {
       /* The argument value must be between 0 to 255.  */
       warning (OPT_Wattributes,
-               "`%s' attribute argument should be between 0 to 255",
-               IDENTIFIER_POINTER (name));
+               "%qE attribute argument should be between 0 to 255",
+               name);
       *no_add_attrs = true;
     }
   return NULL_TREE;
@@ -8258,15 +8258,15 @@ sh_handle_sp_switch_attribute (tree *nod
 {
   if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
   else if (TREE_CODE (TREE_VALUE (args)) != STRING_CST)
     {
       /* The argument must be a constant string.  */
-      warning (OPT_Wattributes, "%qs attribute argument not a string constant",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute argument not a string constant",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -8281,8 +8281,8 @@ sh_handle_trap_exit_attribute (tree *nod
 {
   if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
   /* The argument specifies a trap number to be used in a trapa instruction
@@ -8290,8 +8290,8 @@ sh_handle_trap_exit_attribute (tree *nod
   else if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST)
     {
       /* The argument must be a constant integer.  */
-      warning (OPT_Wattributes, "%qs attribute argument not an "
-	       "integer constant", IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute argument not an "
+	       "integer constant", name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/avr/avr.c
===================================================================
--- gcc/config/avr/avr.c	(revision 147317)
+++ gcc/config/avr/avr.c	(working copy)
@@ -4804,8 +4804,8 @@ avr_handle_progmem_attribute (tree *node
 	}
       else
 	{
-	  warning (OPT_Wattributes, "%qs attribute ignored",
-		   IDENTIFIER_POINTER (name));
+	  warning (OPT_Wattributes, "%qE attribute ignored",
+		   name);
 	  *no_add_attrs = true;
 	}
     }
@@ -4824,8 +4824,8 @@ avr_handle_fndecl_attribute (tree *node,
 {
   if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -4840,8 +4840,8 @@ avr_handle_fntype_attribute (tree *node,
 {
   if (TREE_CODE (*node) != FUNCTION_TYPE)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/stormy16/stormy16.c
===================================================================
--- gcc/config/stormy16/stormy16.c	(revision 147317)
+++ gcc/config/stormy16/stormy16.c	(working copy)
@@ -1,6 +1,6 @@
 /* Xstormy16 target functions.
    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2006, 2007, 2008 Free Software Foundation, Inc.
+   2006, 2007, 2008, 2009 Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
    This file is part of GCC.
@@ -2218,8 +2218,8 @@ xstormy16_handle_interrupt_attribute (tr
 {
   if (TREE_CODE (*node) != FUNCTION_TYPE)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/m68hc11/m68hc11.c
===================================================================
--- gcc/config/m68hc11/m68hc11.c	(revision 147317)
+++ gcc/config/m68hc11/m68hc11.c	(working copy)
@@ -1,6 +1,6 @@
 /* Subroutines for code generation on Motorola 68HC11 and 68HC12.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-   Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+   2009 Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
 
 This file is part of GCC.
@@ -1107,8 +1107,8 @@ m68hc11_handle_page0_attribute (tree *no
     }
   else
     {
-      warning (OPT_Wattributes, "%qs attribute ignored",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute ignored",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -1144,8 +1144,8 @@ m68hc11_handle_fntype_attribute (tree *n
       && TREE_CODE (*node) != FIELD_DECL
       && TREE_CODE (*node) != TYPE_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/ia64/ia64.c
===================================================================
--- gcc/config/ia64/ia64.c	(revision 147317)
+++ gcc/config/ia64/ia64.c	(working copy)
@@ -586,8 +586,8 @@ ia64_handle_model_attribute (tree *node,
     }
   else
     {
-      warning (OPT_Wattributes, "invalid argument of %qs attribute",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "invalid argument of %qE attribute",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -618,8 +618,8 @@ ia64_handle_model_attribute (tree *node,
       break;
 
     default:
-      warning (OPT_Wattributes, "%qs attribute ignored",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute ignored",
+	       name);
       *no_add_attrs = true;
       break;
     }
Index: gcc/config/m68k/m68k.c
===================================================================
--- gcc/config/m68k/m68k.c	(revision 147317)
+++ gcc/config/m68k/m68k.c	(working copy)
@@ -781,8 +781,8 @@ m68k_handle_fndecl_attribute (tree *node
 {
   if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 147317)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -20667,8 +20667,8 @@ rs6000_handle_longcall_attribute (tree *
       && TREE_CODE (*node) != FIELD_DECL
       && TREE_CODE (*node) != TYPE_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -20741,7 +20741,7 @@ rs6000_handle_struct_attribute (tree *no
   if (!(type && (TREE_CODE (*type) == RECORD_TYPE
                  || TREE_CODE (*type) == UNION_TYPE)))
     {
-      warning (OPT_Wattributes, "%qs attribute ignored", IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute ignored", name);
       *no_add_attrs = true;
     }
 
@@ -20750,8 +20750,8 @@ rs6000_handle_struct_attribute (tree *no
            || ((is_attribute_p ("gcc_struct", name)
                 && lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type)))))
     {
-      warning (OPT_Wattributes, "%qs incompatible attribute ignored",
-               IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE incompatible attribute ignored",
+               name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c	(revision 147317)
+++ gcc/config/darwin.c	(working copy)
@@ -1,6 +1,6 @@
 /* Functions for generic Darwin as target machine for GNU C compiler.
    Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007, 2008
+   2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
    Contributed by Apple Computer Inc.
 
@@ -1407,15 +1407,15 @@ darwin_handle_kext_attribute (tree *node
   /* APPLE KEXT stuff -- only applies with pure static C++ code.  */
   if (! TARGET_KEXTABI)
     {
-      warning (0, "%<%s%> 2.95 vtable-compatibility attribute applies "
-	       "only when compiling a kext", IDENTIFIER_POINTER (name));
+      warning (0, "%qE 2.95 vtable-compatibility attribute applies "
+	       "only when compiling a kext", name);
 
       *no_add_attrs = true;
     }
   else if (TREE_CODE (*node) != RECORD_TYPE)
     {
-      warning (0, "%<%s%> 2.95 vtable-compatibility attribute applies "
-	       "only to C++ classes", IDENTIFIER_POINTER (name));
+      warning (0, "%qE 2.95 vtable-compatibility attribute applies "
+	       "only to C++ classes", name);
 
       *no_add_attrs = true;
     }
@@ -1434,8 +1434,8 @@ darwin_handle_weak_import_attribute (tre
 {
   if (TREE_CODE (*node) != FUNCTION_DECL && TREE_CODE (*node) != VAR_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute ignored",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute ignored",
+	       name);
       *no_add_attrs = true;
     }
   else
Index: gcc/config/mcore/mcore.c
===================================================================
--- gcc/config/mcore/mcore.c	(revision 147317)
+++ gcc/config/mcore/mcore.c	(working copy)
@@ -1,6 +1,6 @@
 /* Output routines for Motorola MCore processor
-   Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
-   Free Software Foundation, Inc.
+   Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
+   2009 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -3031,8 +3031,8 @@ mcore_handle_naked_attribute (tree * nod
     }
   else
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/arc/arc.c
===================================================================
--- gcc/config/arc/arc.c	(revision 147317)
+++ gcc/config/arc/arc.c	(working copy)
@@ -1,6 +1,6 @@
 /* Subroutines used for code generation on the Argonaut ARC cpu.
    Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -389,16 +389,16 @@ arc_handle_interrupt_attribute (tree *no
   if (TREE_CODE (value) != STRING_CST)
     {
       warning (OPT_Wattributes,
-	       "argument of %qs attribute is not a string constant",
-	       IDENTIFIER_POINTER (name));
+	       "argument of %qE attribute is not a string constant",
+	       name);
       *no_add_attrs = true;
     }
   else if (strcmp (TREE_STRING_POINTER (value), "ilink1")
 	   && strcmp (TREE_STRING_POINTER (value), "ilink2"))
     {
       warning (OPT_Wattributes,
-	       "argument of %qs attribute is not \"ilink1\" or \"ilink2\"",
-	       IDENTIFIER_POINTER (name));
+	       "argument of %qE attribute is not \"ilink1\" or \"ilink2\"",
+	       name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 147317)
+++ gcc/config/arm/arm.c	(working copy)
@@ -3264,8 +3264,8 @@ arm_handle_fndecl_attribute (tree *node,
 {
   if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -3282,8 +3282,8 @@ arm_handle_isr_attribute (tree *node, tr
     {
       if (TREE_CODE (*node) != FUNCTION_DECL)
 	{
-	  warning (OPT_Wattributes, "%qs attribute only applies to functions",
-		   IDENTIFIER_POINTER (name));
+	  warning (OPT_Wattributes, "%qE attribute only applies to functions",
+		   name);
 	  *no_add_attrs = true;
 	}
       /* FIXME: the argument if any is checked for type attributes;
@@ -3296,8 +3296,8 @@ arm_handle_isr_attribute (tree *node, tr
 	{
 	  if (arm_isr_value (args) == ARM_FT_UNKNOWN)
 	    {
-	      warning (OPT_Wattributes, "%qs attribute ignored",
-		       IDENTIFIER_POINTER (name));
+	      warning (OPT_Wattributes, "%qE attribute ignored",
+		       name);
 	      *no_add_attrs = true;
 	    }
 	}
@@ -3324,8 +3324,8 @@ arm_handle_isr_attribute (tree *node, tr
 	    }
 	  else
 	    {
-	      warning (OPT_Wattributes, "%qs attribute ignored",
-		       IDENTIFIER_POINTER (name));
+	      warning (OPT_Wattributes, "%qE attribute ignored",
+		       name);
 	    }
 	}
     }
Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c	(revision 147317)
+++ gcc/config/mips/mips.c	(working copy)
@@ -1292,9 +1292,9 @@ mips_insert_attributes (tree decl, tree 
 	{
 	  /* DECL cannot be simultaneously "mips16" and "nomips16".  */
 	  if (mips16_p && nomips16_p)
-	    error ("%qs cannot have both %<mips16%> and "
+	    error ("%qE cannot have both %<mips16%> and "
 		   "%<nomips16%> attributes",
-		   IDENTIFIER_POINTER (DECL_NAME (decl)));
+		   DECL_NAME (decl));
 	}
       else if (TARGET_FLIP_MIPS16 && !DECL_ARTIFICIAL (decl))
 	{
@@ -1314,11 +1314,11 @@ mips_merge_decl_attributes (tree olddecl
 {
   /* The decls' "mips16" and "nomips16" attributes must match exactly.  */
   if (mips_mips16_decl_p (olddecl) != mips_mips16_decl_p (newdecl))
-    error ("%qs redeclared with conflicting %qs attributes",
-	   IDENTIFIER_POINTER (DECL_NAME (newdecl)), "mips16");
+    error ("%qE redeclared with conflicting %qs attributes",
+	   DECL_NAME (newdecl), "mips16");
   if (mips_nomips16_decl_p (olddecl) != mips_nomips16_decl_p (newdecl))
-    error ("%qs redeclared with conflicting %qs attributes",
-	   IDENTIFIER_POINTER (DECL_NAME (newdecl)), "nomips16");
+    error ("%qE redeclared with conflicting %qs attributes",
+	   DECL_NAME (newdecl), "nomips16");
 
   return merge_attributes (DECL_ATTRIBUTES (olddecl),
 			   DECL_ATTRIBUTES (newdecl));
@@ -12372,8 +12372,8 @@ mips_expand_builtin (tree exp, rtx targe
   gcc_assert (avail != 0);
   if (TARGET_MIPS16)
     {
-      error ("built-in function %qs not supported for MIPS16",
-	     IDENTIFIER_POINTER (DECL_NAME (fndecl)));
+      error ("built-in function %qE not supported for MIPS16",
+	     DECL_NAME (fndecl));
       return ignore ? const0_rtx : CONST0_RTX (mode);
     }
   switch (d->builtin_type)
Index: gcc/config/h8300/h8300.c
===================================================================
--- gcc/config/h8300/h8300.c	(revision 147317)
+++ gcc/config/h8300/h8300.c	(working copy)
@@ -1,6 +1,6 @@
 /* Subroutines for insn-output.c for Renesas H8/300.
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
    Contributed by Steve Chamberlain (sac@cygnus.com),
    Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
@@ -5256,8 +5256,8 @@ h8300_handle_fndecl_attribute (tree *nod
 {
   if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -5280,8 +5280,8 @@ h8300_handle_eightbit_data_attribute (tr
     }
   else
     {
-      warning (OPT_Wattributes, "%qs attribute ignored",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute ignored",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -5304,8 +5304,8 @@ h8300_handle_tiny_data_attribute (tree *
     }
   else
     {
-      warning (OPT_Wattributes, "%qs attribute ignored",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute ignored",
+	       name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/v850/v850-c.c
===================================================================
--- gcc/config/v850/v850-c.c	(revision 147317)
+++ gcc/config/v850/v850-c.c	(working copy)
@@ -1,5 +1,5 @@
 /* v850 specific, C compiler specific functions.
-   Copyright (C) 2000, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2007, 2009 Free Software Foundation, Inc.
    Contributed by Jeff Law (law@cygnus.com).
 
 This file is part of GCC.
@@ -121,6 +121,7 @@ ghs_pragma_section (cpp_reader * pfile A
     {
       tree x;
       enum cpp_ttype type;
+      tree sect_ident;
       const char *sect, *alias;
       enum GHS_section_kind kind;
       
@@ -129,7 +130,10 @@ ghs_pragma_section (cpp_reader * pfile A
       if (type == CPP_EOF && !repeat)
 	goto reset;
       else if (type == CPP_NAME)
-	sect = IDENTIFIER_POINTER (x);
+	{
+	  sect_ident = x;
+	  sect = IDENTIFIER_POINTER (sect_ident);
+	}
       else
 	goto bad;
       repeat = 0;
@@ -162,7 +166,7 @@ ghs_pragma_section (cpp_reader * pfile A
       else if (streq (sect, "zbss"))    kind = GHS_SECTION_KIND_ZDATA;
       else
 	{
-	  warning (0, "unrecognized section name \"%s\"", sect);
+	  warning (0, "unrecognized section name %qE", sect_ident);
 	  return;
 	}
       
Index: gcc/config/v850/v850.c
===================================================================
--- gcc/config/v850/v850.c	(revision 147317)
+++ gcc/config/v850/v850.c	(working copy)
@@ -1,6 +1,6 @@
 /* Subroutines for insn-output.c for NEC V850 series
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2006, 2007, 2008 Free Software Foundation, Inc.
+   2006, 2007, 2008, 2009 Free Software Foundation, Inc.
    Contributed by Jeff Law (law@cygnus.com).
 
    This file is part of GCC.
@@ -2045,8 +2045,8 @@ v850_handle_interrupt_attribute (tree * 
 {
   if (TREE_CODE (*node) != FUNCTION_DECL)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
Index: gcc/config/bfin/bfin.c
===================================================================
--- gcc/config/bfin/bfin.c	(revision 147317)
+++ gcc/config/bfin/bfin.c	(working copy)
@@ -5267,8 +5267,8 @@ handle_int_attribute (tree *node, tree n
 
   if (TREE_CODE (x) != FUNCTION_TYPE)
     {
-      warning (OPT_Wattributes, "%qs attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
   else if (funkind (x) != SUBROUTINE)
@@ -5328,8 +5328,8 @@ bfin_handle_longcall_attribute (tree *no
       && TREE_CODE (*node) != FIELD_DECL
       && TREE_CODE (*node) != TYPE_DECL)
     {
-      warning (OPT_Wattributes, "`%s' attribute only applies to functions",
-	       IDENTIFIER_POINTER (name));
+      warning (OPT_Wattributes, "%qE attribute only applies to functions",
+	       name);
       *no_add_attrs = true;
     }
 
@@ -5357,8 +5357,8 @@ bfin_handle_l1_text_attribute (tree *nod
 
   if (TREE_CODE (decl) != FUNCTION_DECL)
     {
-      error ("`%s' attribute only applies to functions",
-	     IDENTIFIER_POINTER (name));
+      error ("%qE attribute only applies to functions",
+	     name);
       *no_add_attrs = true;
     }
 
@@ -5389,15 +5389,15 @@ bfin_handle_l1_data_attribute (tree *nod
 
   if (TREE_CODE (decl) != VAR_DECL)
     {
-      error ("`%s' attribute only applies to variables",
-	     IDENTIFIER_POINTER (name));
+      error ("%qE attribute only applies to variables",
+	     name);
       *no_add_attrs = true;
     }
   else if (current_function_decl != NULL_TREE
 	   && !TREE_STATIC (decl))
     {
-      error ("`%s' attribute cannot be specified for local variables",
-	     IDENTIFIER_POINTER (name));
+      error ("%qE attribute cannot be specified for local variables",
+	     name);
       *no_add_attrs = true;
     }
   else

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]