public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
@ 2010-12-22 19:58 Kai Tietz
  2010-12-23  8:33 ` Gabriel Dos Reis
  0 siblings, 1 reply; 19+ messages in thread
From: Kai Tietz @ 2010-12-22 19:58 UTC (permalink / raw)
  To: GCC Patches
  Cc: Gabriel Dos Reis, Joseph S. Myers, Jason Merrill, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]

Hello,

sorry, I sent patch under wrong bug-report. If there is common
agreement for displaying for such types all attributes without
filtering for ABI modifying ones, I will rework that patch.

2010-12-22  Kai Tietz

	PR target/12171
	* c-family/c-pretty-print.c: Add target.h include.
	(pp_c_specifier_qualifier_list): Call
	pp_c_calling_convention_attributes for (*).
	(pp_c_calling_convention_attributes): New.
	* c-family/c-pretty-print.h (pp_c_calling_convention_attributes):
	New prototype.
	* cp/error.c (dump_type_prefix): Call
	pp_c_calling_convention_attributes for (*).
	* cp/cxx-pretty-print.c (pp_cxx_ptr_operator):
	Likewise.
	* config/i386/i386.c (ix86_attribute_affects_calling_convention):
	New hook.
	(TARGET_ATTRIBUTE_AFFECTS_CALLING_CONVENTION): Define.
	* doc/tm.texi.in (TARGET_ATTRIBUTE_AFFECTS_CALLING_CONVENTION): Add.
	* doc/tm.texi: Regenerated.

Regards,
Kai

[-- Attachment #2: dispcallconv.txt --]
[-- Type: text/plain, Size: 7583 bytes --]

Index: gcc/gcc/c-family/c-pretty-print.c
===================================================================
--- gcc.orig/gcc/c-family/c-pretty-print.c	2010-12-22 16:29:55.231892000 +0100
+++ gcc/gcc/c-family/c-pretty-print.c	2010-12-22 16:39:57.923249700 +0100
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.  
 #include "tree-pretty-print.h"
 #include "tree-iterator.h"
 #include "diagnostic.h"
+#include "target.h"
 
 /* Translate if being used for diagnostics, but not for dump files or
    __PRETTY_FUNCTION.  */
@@ -460,6 +461,7 @@ pp_c_specifier_qualifier_list (c_pretty_
 	  {
 	    pp_c_whitespace (pp);
 	    pp_c_left_paren (pp);
+	    pp_c_calling_convention_attributes (pp, TYPE_ATTRIBUTES (pointee));
 	  }
 	else if (!c_dialect_cxx ())
 	  pp_c_whitespace (pp);
@@ -790,6 +792,45 @@ pp_c_attributes (c_pretty_printer *pp, t
   pp_c_right_paren (pp);
 }
 
+/* Pretty-print ATTRIBUTES using GNU C extension syntax for calling
+   convention affecting attributes.  */
+
+void
+pp_c_calling_convention_attributes (c_pretty_printer *pp, tree a)
+{
+  bool is_first = true;
+
+  if (a == NULL_TREE)
+    return;
+
+  for (; a != NULL_TREE; a = TREE_CHAIN (a))
+    {
+      if (!targetm.attribute_affects_calling_convention (TREE_PURPOSE (a)))
+        continue;
+      if (is_first)
+	{
+	  pp_c_ws_string (pp, "__attribute__");
+	  pp_c_left_paren (pp);
+	  pp_c_left_paren (pp);
+	  is_first = false;
+	}
+      else
+	{
+	  pp_separate_with (pp, ',');
+	}
+      pp_tree_identifier (pp, TREE_PURPOSE (a));
+      if (TREE_VALUE (a))
+	pp_c_call_argument_list (pp, TREE_VALUE (a));
+    }
+
+  if (!is_first)
+    {
+      pp_c_right_paren (pp);
+      pp_c_right_paren (pp);
+      pp_c_whitespace (pp);
+    }
+}
+
 /* function-definition:
       declaration-specifiers declarator compound-statement  */
 
Index: gcc/gcc/cp/error.c
===================================================================
--- gcc.orig/gcc/cp/error.c	2010-12-22 16:29:55.237892000 +0100
+++ gcc/gcc/cp/error.c	2010-12-22 16:39:58.001375200 +0100
@@ -661,6 +661,8 @@ dump_type_prefix (tree t, int flags)
 	  {
 	    pp_cxx_whitespace (cxx_pp);
 	    pp_cxx_left_paren (cxx_pp);
+	    pp_c_calling_convention_attributes (pp_c_base (cxx_pp),
+						TYPE_ATTRIBUTES (sub));
 	  }
 	if (TREE_CODE (t) == POINTER_TYPE)
 	  pp_character(cxx_pp, '*');
Index: gcc/gcc/c-family/c-pretty-print.h
===================================================================
--- gcc.orig/gcc/c-family/c-pretty-print.h	2010-12-22 16:29:55.232892000 +0100
+++ gcc/gcc/c-family/c-pretty-print.h	2010-12-22 16:39:58.032625400 +0100
@@ -176,6 +176,7 @@ void pp_c_space_for_pointer_operator (c_
 void pp_c_tree_decl_identifier (c_pretty_printer *, tree);
 void pp_c_function_definition (c_pretty_printer *, tree);
 void pp_c_attributes (c_pretty_printer *, tree);
+void pp_c_calling_convention_attributes (c_pretty_printer *, tree);
 void pp_c_cv_qualifiers (c_pretty_printer *pp, int qualifiers, bool func_type);
 void pp_c_type_qualifier_list (c_pretty_printer *, tree);
 void pp_c_parameter_type_list (c_pretty_printer *, tree);
Index: gcc/gcc/config/i386/i386.c
===================================================================
--- gcc.orig/gcc/config/i386/i386.c	2010-12-22 16:29:55.235892000 +0100
+++ gcc/gcc/config/i386/i386.c	2010-12-22 16:39:58.048250500 +0100
@@ -5116,6 +5116,46 @@ ix86_function_ok_for_sibcall (tree decl,
   return true;
 }
 
+static bool
+ix86_attribute_affects_calling_convention (tree name)
+{
+  int ident_len;
+  const char *p;
+
+  gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
+  p = IDENTIFIER_POINTER (name);
+  ident_len = IDENTIFIER_LENGTH (name);
+
+  if (ident_len > 4 && p[0] == '_' && p[1] == '_' && p[ident_len - 1] == '_'
+      && p[ident_len - 2] == '_')
+    {
+      ident_len -= 4;
+      p += 2;
+    }
+  switch (ident_len)
+    {
+    case 5:
+      if (!strncmp (p, "cdecl", 5))
+        return true;
+      break;
+    case 6:
+      if (!strncmp (p, "ms_abi", 6))
+        return true;
+      break;
+    case 7:
+      if (!strncmp (p, "regparm", 7) || !strncmp (p, "stdcall", 7))
+        return true;
+      break;
+    case 8:
+      if (!strncmp (p, "thiscall", 8) || !strncmp (p, "fastcall", 8)
+          || !strncmp (p, "sysv_abi", 8))
+        return true;
+      break;
+    }
+
+  return false;
+}
+
 /* Handle "cdecl", "stdcall", "fastcall", "regparm", "thiscall",
    and "sseregparm" calling convention attributes;
    arguments as in struct attribute_spec.handler.  */
@@ -34813,6 +34853,10 @@ ix86_autovectorize_vector_sizes (void)
 #undef TARGET_CONDITIONAL_REGISTER_USAGE
 #define TARGET_CONDITIONAL_REGISTER_USAGE ix86_conditional_register_usage
 
+#undef TARGET_ATTRIBUTE_AFFECTS_CALLING_CONVENTION
+#define TARGET_ATTRIBUTE_AFFECTS_CALLING_CONVENTION \
+  ix86_attribute_affects_calling_convention
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 #include "gt-i386.h"
Index: gcc/gcc/doc/tm.texi
===================================================================
--- gcc.orig/gcc/doc/tm.texi	2010-12-22 16:29:55.239892000 +0100
+++ gcc/gcc/doc/tm.texi	2010-12-22 16:39:58.157626200 +0100
@@ -9765,6 +9765,10 @@ to perform initial processing of the @sa
 @file{i386/i386.c}, for example.
 @end deftypefn
 
+@deftypefn {Target Hook} bool TARGET_ATTRIBUTE_AFFECTS_CALLING_CONVENTION (const_tree @var{name})
+Returns @code{true} if given attribute by its @var{name} affects calling convention, otherwise @code{false}.
+@end deftypefn
+
 @deftypefn {Target Hook} bool TARGET_VALID_DLLIMPORT_ATTRIBUTE_P (const_tree @var{decl})
 @var{decl} is a variable or function with @code{__attribute__((dllimport))} specified.  Use this hook if the target needs to add extra validation checks to @code{handle_dll_attribute}.
 @end deftypefn
Index: gcc/gcc/doc/tm.texi.in
===================================================================
--- gcc.orig/gcc/doc/tm.texi.in	2010-12-22 16:29:55.241892000 +0100
+++ gcc/gcc/doc/tm.texi.in	2010-12-22 16:39:58.282627000 +0100
@@ -9729,6 +9729,8 @@ to perform initial processing of the @sa
 @file{i386/i386.c}, for example.
 @end deftypefn
 
+@hook TARGET_ATTRIBUTE_AFFECTS_CALLING_CONVENTION
+
 @hook TARGET_VALID_DLLIMPORT_ATTRIBUTE_P
 
 @defmac TARGET_DECLSPEC
Index: gcc/gcc/target.def
===================================================================
--- gcc.orig/gcc/target.def	2010-12-22 16:29:55.243892000 +0100
+++ gcc/gcc/target.def	2010-12-22 16:39:58.282627000 +0100
@@ -1113,6 +1113,14 @@ DEFHOOK
  tree, (tree olddecl, tree newdecl),
  merge_decl_attributes)
 
+/* Return true iff attribute NAME affects calling convention. */
+DEFHOOK
+(attribute_affects_calling_convention,
+ "Returns @code{true} if given attribute by its @var{name} affects calling\
+ convention, otherwise @code{false}.",
+ bool, (const_tree name),
+ hook_bool_const_tree_false)
+
 /* Given two types, merge their attributes and return the result.  */
 DEFHOOK
 (merge_type_attributes,
Index: gcc/gcc/cp/cxx-pretty-print.c
===================================================================
--- gcc.orig/gcc/cp/cxx-pretty-print.c	2010-12-22 12:10:20.000000000 +0100
+++ gcc/gcc/cp/cxx-pretty-print.c	2010-12-22 16:48:14.020174700 +0100
@@ -1323,6 +1323,9 @@ pp_cxx_ptr_operator (cxx_pretty_printer 
       if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE
 	  || TYPE_PTR_TO_MEMBER_P (TREE_TYPE (t)))
 	pp_cxx_ptr_operator (pp, TREE_TYPE (t));
+      pp_c_calling_convention_attributes (pp_c_base (pp),
+					  TYPE_ATTRIBUTES (TREE_TYPE (t)));
+
       if (TREE_CODE (t) == POINTER_TYPE)
 	{
 	  pp_star (pp);


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2010-12-22 19:58 [patch i386,c,c++]: PR/12171 - calling convention omitted in error message Kai Tietz
@ 2010-12-23  8:33 ` Gabriel Dos Reis
  2010-12-23 10:25   ` Jason Merrill
  2010-12-23 13:34   ` Joseph S. Myers
  0 siblings, 2 replies; 19+ messages in thread
From: Gabriel Dos Reis @ 2010-12-23  8:33 UTC (permalink / raw)
  To: Kai Tietz; +Cc: GCC Patches, Joseph S. Myers, Jason Merrill, Richard Henderson

On Wed, Dec 22, 2010 at 12:24 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
> Hello,
>
> sorry, I sent patch under wrong bug-report. If there is common
> agreement for displaying for such types all attributes without
> filtering for ABI modifying ones, I will rework that patch.
>
> 2010-12-22  Kai Tietz
>
>        PR target/12171
>        * c-family/c-pretty-print.c: Add target.h include.
>        (pp_c_specifier_qualifier_list): Call
>        pp_c_calling_convention_attributes for (*).
>        (pp_c_calling_convention_attributes): New.
>        * c-family/c-pretty-print.h (pp_c_calling_convention_attributes):
>        New prototype.
>        * cp/error.c (dump_type_prefix): Call
>        pp_c_calling_convention_attributes for (*).
>        * cp/cxx-pretty-print.c (pp_cxx_ptr_operator):
>        Likewise.
>        * config/i386/i386.c (ix86_attribute_affects_calling_convention):
>        New hook.
>        (TARGET_ATTRIBUTE_AFFECTS_CALLING_CONVENTION): Define.
>        * doc/tm.texi.in (TARGET_ATTRIBUTE_AFFECTS_CALLING_CONVENTION): Add.
>        * doc/tm.texi: Regenerated.

I'm satisfied with the patch.
I'm opposed to printing all attributes -- the resulting sea of
irrelevant information,
for most cases, is counterproductive.

>
> Regards,
> Kai
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2010-12-23  8:33 ` Gabriel Dos Reis
@ 2010-12-23 10:25   ` Jason Merrill
  2010-12-23 11:28     ` Ian Lance Taylor
  2010-12-23 13:34   ` Joseph S. Myers
  1 sibling, 1 reply; 19+ messages in thread
From: Jason Merrill @ 2010-12-23 10:25 UTC (permalink / raw)
  To: Gabriel Dos Reis
  Cc: Kai Tietz, GCC Patches, Joseph S. Myers, Richard Henderson,
	Ian Lance Taylor

On 12/22/2010 09:29 PM, Gabriel Dos Reis wrote:
> I'm opposed to printing all attributes -- the resulting sea of
> irrelevant information, for most cases, is counterproductive.

How often do types have anything in TYPE_ATTRIBUTES, much less 
irrelevant attributes?  I can't imagine such a change making any 
difference for most code, and it's likely to help for any code that it 
does affect.

(Adding Ian to the CC list since he apparently had an opinion)

Jason

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2010-12-23 10:25   ` Jason Merrill
@ 2010-12-23 11:28     ` Ian Lance Taylor
  0 siblings, 0 replies; 19+ messages in thread
From: Ian Lance Taylor @ 2010-12-23 11:28 UTC (permalink / raw)
  To: Jason Merrill
  Cc: Gabriel Dos Reis, Kai Tietz, GCC Patches, Joseph S. Myers,
	Richard Henderson

Jason Merrill <jason@redhat.com> writes:

> On 12/22/2010 09:29 PM, Gabriel Dos Reis wrote:
>> I'm opposed to printing all attributes -- the resulting sea of
>> irrelevant information, for most cases, is counterproductive.
>
> How often do types have anything in TYPE_ATTRIBUTES, much less
> irrelevant attributes?  I can't imagine such a change making any
> difference for most code, and it's likely to help for any code that it
> does affect.
>
> (Adding Ian to the CC list since he apparently had an opinion)

I am definitely opposed to printing all attributes for functions.

I'm not excited about printing attributes for types, although I agree
that it matters less there.  It seems wrong to print attributes like
"unused" or "may_alias" for types.  Note that "may_alias" is used in
<mmintrin.h> and friends.

Ian

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2010-12-23  8:33 ` Gabriel Dos Reis
  2010-12-23 10:25   ` Jason Merrill
@ 2010-12-23 13:34   ` Joseph S. Myers
  2010-12-23 16:29     ` Gabriel Dos Reis
  1 sibling, 1 reply; 19+ messages in thread
From: Joseph S. Myers @ 2010-12-23 13:34 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: Kai Tietz, GCC Patches, Jason Merrill, Richard Henderson

On Wed, 22 Dec 2010, Gabriel Dos Reis wrote:

> I'm satisfied with the patch.

I still maintain that even if you do wish to print only some attributes 
(in which case I'd say the hook should be a hook to say what target 
attributes to print, not one saying what's a calling convention 
attribute, since the two sets need not be the same) the duplication 
between ix86_attribute_affects_calling_convention and other functions in 
knowing what attributes are calling convention attributes is best avoided.  
And manually handling the possibility of leading and trailing __ in a back 
end is certainly a bad idea; we have a perfectly good is_attribute_p 
function to handle this in one place only.

Even better than a hook saying whether to print an attribute would be an 
additional field in struct attribute_spec saying whether an attribute 
(target or not) should be printed.  That way the information - if you do 
want to print only some attributes - would be provided via an existing 
data hook rather than needing a new function hook at all, and you can 
easily start printing some target-independent attributes as well if 
desired.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2010-12-23 13:34   ` Joseph S. Myers
@ 2010-12-23 16:29     ` Gabriel Dos Reis
  2011-01-01 18:07       ` Kai Tietz
  0 siblings, 1 reply; 19+ messages in thread
From: Gabriel Dos Reis @ 2010-12-23 16:29 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Kai Tietz, GCC Patches, Jason Merrill, Richard Henderson

On Thu, Dec 23, 2010 at 6:25 AM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Wed, 22 Dec 2010, Gabriel Dos Reis wrote:
>
>> I'm satisfied with the patch.
>
> I still maintain that even if you do wish to print only some attributes
> (in which case I'd say the hook should be a hook to say what target
> attributes to print, not one saying what's a calling convention
> attribute, since the two sets need not be the same) the duplication
> between ix86_attribute_affects_calling_convention and other functions in
> knowing what attributes are calling convention attributes is best avoided.
> And manually handling the possibility of leading and trailing __ in a back
> end is certainly a bad idea; we have a perfectly good is_attribute_p
> function to handle this in one place only.
>
> Even better than a hook saying whether to print an attribute would be an
> additional field in struct attribute_spec saying whether an attribute
> (target or not) should be printed.  That way the information - if you do
> want to print only some attributes - would be provided via an existing
> data hook rather than needing a new function hook at all, and you can
> easily start printing some target-independent attributes as well if
> desired.

I agree that code duplication is not a good idea, and your suggestion of
is_attribute_p is a very good one.

On ther other hand, we should not embark on the road of printing
all possible attributes in a type, so having a general purpose
hook for that does not strike me as a good think.  That leaves the
possibility of adding a field to attribute_spec which I like.

-- Gaby

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2010-12-23 16:29     ` Gabriel Dos Reis
@ 2011-01-01 18:07       ` Kai Tietz
  2011-01-04 22:37         ` Jason Merrill
  0 siblings, 1 reply; 19+ messages in thread
From: Kai Tietz @ 2011-01-01 18:07 UTC (permalink / raw)
  To: Gabriel Dos Reis
  Cc: Joseph S. Myers, GCC Patches, Jason Merrill, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 5041 bytes --]

2010/12/23 Gabriel Dos Reis <gdr@integrable-solutions.net>:
> On Thu, Dec 23, 2010 at 6:25 AM, Joseph S. Myers
> <joseph@codesourcery.com> wrote:
>> On Wed, 22 Dec 2010, Gabriel Dos Reis wrote:
>>
>>> I'm satisfied with the patch.
>>
>> I still maintain that even if you do wish to print only some attributes
>> (in which case I'd say the hook should be a hook to say what target
>> attributes to print, not one saying what's a calling convention
>> attribute, since the two sets need not be the same) the duplication
>> between ix86_attribute_affects_calling_convention and other functions in
>> knowing what attributes are calling convention attributes is best avoided.
>> And manually handling the possibility of leading and trailing __ in a back
>> end is certainly a bad idea; we have a perfectly good is_attribute_p
>> function to handle this in one place only.
>>
>> Even better than a hook saying whether to print an attribute would be an
>> additional field in struct attribute_spec saying whether an attribute
>> (target or not) should be printed.  That way the information - if you do
>> want to print only some attributes - would be provided via an existing
>> data hook rather than needing a new function hook at all, and you can
>> easily start printing some target-independent attributes as well if
>> desired.
>
> I agree that code duplication is not a good idea, and your suggestion of
> is_attribute_p is a very good one.
>
> On ther other hand, we should not embark on the road of printing
> all possible attributes in a type, so having a general purpose
> hook for that does not strike me as a good think.  That leaves the
> possibility of adding a field to attribute_spec which I like.
>
> -- Gaby
>

Well, as here no further agreement was found, I post here the
alternative suggested by Joseph. I am open-minded which approach will
be choosen. I just want to fix this long pending issue.
I splitted up this patch in two parts. The first simply extends the
struct attribute_spec by new member 'on_diagnostic' and extends the
the uses of this structure by this new field. This new member
specifiedsif the attribute shall be show on diagnostic output, or not.

ChangeLog gcc/

2011-01-01  Kai Tietz

	PR target/12171
	* doc/plugins.texi: Adjust documentation
	for plugin register_callback.
	* tree.h (attribute_spec): Add new member
	on_diagnostic.
	* attribs.c (empty_attribute_table): Adjust
	attribute_spec initializers.
	* config/alpha/alpha.c: Likewise.
	* config/arc/arc.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/avr/avr.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/crx/crx.c: Likewise.
	* config/darwin.h: Likewise.
	* config/h8300/h8300.c: Likewise.
	* config/i386/cygming.h: Likewise.
	* config/i386/i386.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/m32c/m32c.c: Likewise.
	* config/m32r/m32r.c: Likewise.
	* config/m68hc11/m68hc11.c: Likewise.
	* config/m68k/m68k.c: Likewise.
	* config/mcore/mcore.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/microblaze/microblaze.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/rx/rx.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sol2.h: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/spu/spu.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/v850/v850.c: Likewise.

ChangeLog gcc/cp

2011-01-01  Kai Tietz

	PR target/12171
	* tree.c (cxx_attribute_table): Adjust table.

ChangeLog gcc/testsuite

2011-01-01  Kai Tietz

	PR target/12171
	* g++.dg/plugin/attribute_plugin.c: Adjust test.

ChangeLog gcc/java

2011-01-01  Kai Tietz

	PR target/12171
	* lang.c (java_attribute_table): Adjust table.

ChangeLog gcc/lto

2011-01-01  Kai Tietz

	PR target/12171
	* lto-lang.c (lto_attribute_table): Adjust table.

ChangeLog gcc/ada

2011-01-01  Kai Tietz

	PR target/12171
	* gcc-interface/utils.c (gnat_internal_attribute_table):
	Add new element.

ChangeLog gcc/c-family

2011-01-01  Kai Tietz

	PR target/12171
	* c-common.c (c_common_attribute_table):
	Add new element.
	(c_common_format_attribute_table): Likewise.

The second part is the patch for c and c++ frontend parts to use new
diagnostic option for displaying of function pointer types.

ChangeLog gcc/c-family

2011-01-01  Kai Tietz

	PR target/12171
	* c-pretty-print.c (pp_c_specifier_qualifier_list):
	Display allowed attributes for function pointer types.
	(pp_c_attributes_display): New function to display
	attributes having on_diagnostic flag set to true.
	* c-pretty-print.h (pp_c_attributes_display): New prototype.

ChangeLog gcc/cp

2011-01-01  Kai Tietz

	PR target/12171
	* cxx-pretty-print.c (pp_cxx_ptr_operator):
	Display allowed attributes for function pointer types.
	* error.c (dump_type_prefix): Likewise.

Test is tested for i686-pc-linux, x86_64-pc-linux, x86_64-w64-mingw32,
i686-pc-cygwin.

Ok for apply?

Regards,
Kai

[-- Attachment #2: dispattr.txt --]
[-- Type: text/plain, Size: 63091 bytes --]

Index: gcc/gcc/ada/gcc-interface/utils.c
===================================================================
--- gcc.orig/gcc/ada/gcc-interface/utils.c	2011-01-01 11:45:49.000000000 +0100
+++ gcc/gcc/ada/gcc-interface/utils.c	2011-01-01 14:23:07.215112400 +0100
@@ -104,29 +104,42 @@ static tree fake_attribute_handler
    this minimal set of attributes to accommodate the needs of builtins.  */
 const struct attribute_spec gnat_internal_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "const",        0, 0,  true,  false, false, handle_const_attribute   },
-  { "nothrow",      0, 0,  true,  false, false, handle_nothrow_attribute },
-  { "pure",         0, 0,  true,  false, false, handle_pure_attribute },
-  { "no vops",      0, 0,  true,  false, false, handle_novops_attribute },
-  { "nonnull",      0, -1, false, true,  true,  handle_nonnull_attribute },
-  { "sentinel",     0, 1,  false, true,  true,  handle_sentinel_attribute },
-  { "noreturn",     0, 0,  true,  false, false, handle_noreturn_attribute },
-  { "leaf",         0, 0,  true,  false, false, handle_leaf_attribute },
-  { "malloc",       0, 0,  true,  false, false, handle_malloc_attribute },
-  { "type generic", 0, 0,  false, true, true, handle_type_generic_attribute },
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "const",        0, 0,  true,  false, false, handle_const_attribute,
+    false },
+  { "nothrow",      0, 0,  true,  false, false, handle_nothrow_attribute,
+    false },
+  { "pure",         0, 0,  true,  false, false, handle_pure_attribute,
+    false },
+  { "no vops",      0, 0,  true,  false, false, handle_novops_attribute,
+    false },
+  { "nonnull",      0, -1, false, true,  true,  handle_nonnull_attribute,
+    false },
+  { "sentinel",     0, 1,  false, true,  true,  handle_sentinel_attribute,
+    false },
+  { "noreturn",     0, 0,  true,  false, false, handle_noreturn_attribute,
+    false },
+  { "leaf",         0, 0,  true,  false, false, handle_leaf_attribute,
+    false },
+  { "malloc",       0, 0,  true,  false, false, handle_malloc_attribute,
+    false },
+  { "type generic", 0, 0,  false, true, true, handle_type_generic_attribute,
+    false },
 
-  { "vector_size",  1, 1,  false, true, false,  handle_vector_size_attribute },
-  { "vector_type",  0, 0,  false, true, false,  handle_vector_type_attribute },
-  { "may_alias",    0, 0, false, true, false, NULL },
+  { "vector_size",  1, 1,  false, true, false,  handle_vector_size_attribute,
+    false },
+  { "vector_type",  0, 0,  false, true, false,  handle_vector_type_attribute,
+    false },
+  { "may_alias",    0, 0, false, true, false, NULL, false },
 
   /* ??? format and format_arg are heavy and not supported, which actually
      prevents support for stdio builtins, which we however declare as part
      of the common builtins.def contents.  */
-  { "format",     3, 3,  false, true,  true,  fake_attribute_handler },
-  { "format_arg", 1, 1,  false, true,  true,  fake_attribute_handler },
+  { "format",     3, 3,  false, true,  true,  fake_attribute_handler, false },
+  { "format_arg", 1, 1,  false, true,  true,  fake_attribute_handler, false },
 
-  { NULL,         0, 0, false, false, false, NULL }
+  { NULL,         0, 0, false, false, false, NULL, false }
 };
 
 /* Associates a GNAT tree node to a GCC tree node. It is used in
Index: gcc/gcc/attribs.c
===================================================================
--- gcc.orig/gcc/attribs.c	2010-09-09 16:09:44.000000000 +0200
+++ gcc/gcc/attribs.c	2011-01-01 14:25:16.837526400 +0100
@@ -57,7 +57,7 @@ static bool attributes_initialized = fal
 
 static const struct attribute_spec empty_attribute_table[] =
 {
-  { NULL, 0, 0, false, false, false, NULL }
+  { NULL, 0, 0, false, false, false, NULL, false }
 };
 
 /* Return base name of the attribute.  Ie '__attr__' is turned into 'attr'.
Index: gcc/gcc/c-family/c-common.c
===================================================================
--- gcc.orig/gcc/c-family/c-common.c	2011-01-01 14:17:50.000000000 +0100
+++ gcc/gcc/c-family/c-common.c	2011-01-01 16:05:47.483459600 +0100
@@ -585,123 +585,125 @@ const unsigned int num_c_common_reswords
 /* Table of machine-independent attributes common to all C-like languages.  */
 const struct attribute_spec c_common_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
   { "packed",                 0, 0, false, false, false,
-			      handle_packed_attribute },
+			      handle_packed_attribute , false},
   { "nocommon",               0, 0, true,  false, false,
-			      handle_nocommon_attribute },
+			      handle_nocommon_attribute, false},
   { "common",                 0, 0, true,  false, false,
-			      handle_common_attribute },
+			      handle_common_attribute, false },
   /* FIXME: logically, noreturn attributes should be listed as
      "false, true, true" and apply to function types.  But implementing this
      would require all the places in the compiler that use TREE_THIS_VOLATILE
      on a decl to identify non-returning functions to be located and fixed
      to check the function type instead.  */
   { "noreturn",               0, 0, true,  false, false,
-			      handle_noreturn_attribute },
+			      handle_noreturn_attribute, false },
   { "volatile",               0, 0, true,  false, false,
-			      handle_noreturn_attribute },
+			      handle_noreturn_attribute, false },
   { "noinline",               0, 0, true,  false, false,
-			      handle_noinline_attribute },
+			      handle_noinline_attribute, false },
   { "noclone",                0, 0, true,  false, false,
-			      handle_noclone_attribute },
+			      handle_noclone_attribute, false },
   { "leaf",                   0, 0, true,  false, false,
-			      handle_leaf_attribute },
+			      handle_leaf_attribute, false },
   { "always_inline",          0, 0, true,  false, false,
-			      handle_always_inline_attribute },
+			      handle_always_inline_attribute, false },
   { "gnu_inline",             0, 0, true,  false, false,
-			      handle_gnu_inline_attribute },
+			      handle_gnu_inline_attribute, false },
   { "artificial",             0, 0, true,  false, false,
-			      handle_artificial_attribute },
+			      handle_artificial_attribute, false },
   { "flatten",                0, 0, true,  false, false,
-			      handle_flatten_attribute },
+			      handle_flatten_attribute, false },
   { "used",                   0, 0, true,  false, false,
-			      handle_used_attribute },
+			      handle_used_attribute, false },
   { "unused",                 0, 0, false, false, false,
-			      handle_unused_attribute },
+			      handle_unused_attribute, false },
   { "externally_visible",     0, 0, true,  false, false,
-			      handle_externally_visible_attribute },
+			      handle_externally_visible_attribute, false },
   /* The same comments as for noreturn attributes apply to const ones.  */
   { "const",                  0, 0, true,  false, false,
-			      handle_const_attribute },
+			      handle_const_attribute, false },
   { "transparent_union",      0, 0, false, false, false,
-			      handle_transparent_union_attribute },
+			      handle_transparent_union_attribute, false },
   { "constructor",            0, 1, true,  false, false,
-			      handle_constructor_attribute },
+			      handle_constructor_attribute, false },
   { "destructor",             0, 1, true,  false, false,
-			      handle_destructor_attribute },
+			      handle_destructor_attribute, false },
   { "mode",                   1, 1, false,  true, false,
-			      handle_mode_attribute },
+			      handle_mode_attribute, false },
   { "section",                1, 1, true,  false, false,
-			      handle_section_attribute },
+			      handle_section_attribute, false },
   { "aligned",                0, 1, false, false, false,
-			      handle_aligned_attribute },
+			      handle_aligned_attribute, false },
   { "weak",                   0, 0, true,  false, false,
-			      handle_weak_attribute },
+			      handle_weak_attribute, false },
   { "ifunc",                  1, 1, true,  false, false,
-			      handle_ifunc_attribute },
+			      handle_ifunc_attribute, false },
   { "alias",                  1, 1, true,  false, false,
-			      handle_alias_attribute },
+			      handle_alias_attribute, false },
   { "weakref",                0, 1, true,  false, false,
-			      handle_weakref_attribute },
+			      handle_weakref_attribute, false },
   { "no_instrument_function", 0, 0, true,  false, false,
-			      handle_no_instrument_function_attribute },
+			      handle_no_instrument_function_attribute,
+			      false },
   { "malloc",                 0, 0, true,  false, false,
-			      handle_malloc_attribute },
+			      handle_malloc_attribute, false },
   { "returns_twice",          0, 0, true,  false, false,
-			      handle_returns_twice_attribute },
+			      handle_returns_twice_attribute, false },
   { "no_stack_limit",         0, 0, true,  false, false,
-			      handle_no_limit_stack_attribute },
+			      handle_no_limit_stack_attribute, false },
   { "pure",                   0, 0, true,  false, false,
-			      handle_pure_attribute },
+			      handle_pure_attribute, false },
   /* For internal use (marking of builtins) only.  The name contains space
      to prevent its usage in source code.  */
   { "no vops",                0, 0, true,  false, false,
-			      handle_novops_attribute },
+			      handle_novops_attribute, false },
   { "deprecated",             0, 1, false, false, false,
-			      handle_deprecated_attribute },
+			      handle_deprecated_attribute, false },
   { "vector_size",	      1, 1, false, true, false,
-			      handle_vector_size_attribute },
+			      handle_vector_size_attribute, false },
   { "visibility",	      1, 1, false, false, false,
-			      handle_visibility_attribute },
+			      handle_visibility_attribute, false },
   { "tls_model",	      1, 1, true,  false, false,
-			      handle_tls_model_attribute },
+			      handle_tls_model_attribute, false },
   { "nonnull",                0, -1, false, true, true,
-			      handle_nonnull_attribute },
+			      handle_nonnull_attribute, false },
   { "nothrow",                0, 0, true,  false, false,
-			      handle_nothrow_attribute },
-  { "may_alias",	      0, 0, false, true, false, NULL },
+			      handle_nothrow_attribute, false },
+  { "may_alias",	      0, 0, false, true, false, NULL, false },
   { "cleanup",		      1, 1, true, false, false,
-			      handle_cleanup_attribute },
+			      handle_cleanup_attribute, false },
   { "warn_unused_result",     0, 0, false, true, true,
-			      handle_warn_unused_result_attribute },
+			      handle_warn_unused_result_attribute, false },
   { "sentinel",               0, 1, false, true, true,
-			      handle_sentinel_attribute },
+			      handle_sentinel_attribute, false },
   /* For internal use (marking of builtins) only.  The name contains space
      to prevent its usage in source code.  */
   { "type generic",           0, 0, false, true, true,
-			      handle_type_generic_attribute },
+			      handle_type_generic_attribute, false },
   { "alloc_size",	      1, 2, false, true, true,
-			      handle_alloc_size_attribute },
+			      handle_alloc_size_attribute, false },
   { "cold",                   0, 0, true,  false, false,
-			      handle_cold_attribute },
+			      handle_cold_attribute, false },
   { "hot",                    0, 0, true,  false, false,
-			      handle_hot_attribute },
+			      handle_hot_attribute, false },
   { "warning",		      1, 1, true,  false, false,
-			      handle_error_attribute },
+			      handle_error_attribute, false },
   { "error",		      1, 1, true,  false, false,
-			      handle_error_attribute },
+			      handle_error_attribute, false },
   { "target",                 1, -1, true, false, false,
-			      handle_target_attribute },
+			      handle_target_attribute, false },
   { "optimize",               1, -1, true, false, false,
-			      handle_optimize_attribute },
+			      handle_optimize_attribute, false },
   { "no_split_stack",	      0, 0, true,  false, false,
-			      handle_no_split_stack_attribute },
+			      handle_no_split_stack_attribute, false },
   /* For internal use (marking of builtins and runtime functions) only.
      The name contains space to prevent its usage in source code.  */
   { "fn spec",	 	      1, 1, false, true, true,
-			      handle_fnspec_attribute },
-  { NULL,                     0, 0, false, false, false, NULL }
+			      handle_fnspec_attribute, false },
+  { NULL,                     0, 0, false, false, false, NULL, false }
 };
 
 /* Give the specifications for the format attributes, used by C and all
@@ -709,12 +711,13 @@ const struct attribute_spec c_common_att
 
 const struct attribute_spec c_common_format_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
   { "format",                 3, 3, false, true,  true,
-			      handle_format_attribute },
+			      handle_format_attribute, false },
   { "format_arg",             1, 1, false, true,  true,
-			      handle_format_arg_attribute },
-  { NULL,                     0, 0, false, false, false, NULL }
+			      handle_format_arg_attribute, false },
+  { NULL,                     0, 0, false, false, false, NULL, false }
 };
 
 /* Return identifier for address space AS.  */
Index: gcc/gcc/config/alpha/alpha.c
===================================================================
--- gcc.orig/gcc/config/alpha/alpha.c	2010-12-01 17:52:50.000000000 +0100
+++ gcc/gcc/config/alpha/alpha.c	2011-01-01 14:26:20.608173900 +0100
@@ -7582,9 +7582,10 @@ common_object_handler (tree *node, tree
 
 static const struct attribute_spec vms_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { COMMON_OBJECT,   0, 1, true,  false, false, common_object_handler },
-  { NULL,            0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { COMMON_OBJECT,   0, 1, true,  false, false, common_object_handler, false },
+  { NULL,            0, 0, false, false, false, NULL, false }
 };
 
 void
Index: gcc/gcc/config/arc/arc.c
===================================================================
--- gcc.orig/gcc/config/arc/arc.c	2010-12-01 17:52:54.000000000 +0100
+++ gcc/gcc/config/arc/arc.c	2011-01-01 14:27:34.958426500 +0100
@@ -107,9 +107,11 @@ static void arc_conditional_register_usa
 
 static const struct attribute_spec arc_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt", 1, 1, true,  false, false, arc_handle_interrupt_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "interrupt", 1, 1, true,  false, false, arc_handle_interrupt_attribute,
+    false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 \f
 /* Initialize the GCC target structure.  */
Index: gcc/gcc/config/arm/arm.c
===================================================================
--- gcc.orig/gcc/config/arm/arm.c	2010-12-31 18:05:52.000000000 +0100
+++ gcc/gcc/config/arm/arm.c	2011-01-01 14:30:37.454864700 +0100
@@ -255,20 +255,25 @@ static reg_class_t arm_preferred_rename_
 /* Table of machine attributes.  */
 static const struct attribute_spec arm_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
   /* Function calls made to this symbol must be done indirectly, because
      it may lie outside of the 26 bit addressing range of a normal function
      call.  */
-  { "long_call",    0, 0, false, true,  true,  NULL },
+  { "long_call",    0, 0, false, true,  true,  NULL, false },
   /* Whereas these functions are always known to reside within the 26 bit
      addressing range.  */
-  { "short_call",   0, 0, false, true,  true,  NULL },
+  { "short_call",   0, 0, false, true,  true,  NULL, false },
   /* Specify the procedure call conventions for a function.  */
-  { "pcs",          1, 1, false, true,  true,  arm_handle_pcs_attribute },
+  { "pcs",          1, 1, false, true,  true,  arm_handle_pcs_attribute,
+    false },
   /* Interrupt Service Routines have special prologue and epilogue requirements.  */
-  { "isr",          0, 1, false, false, false, arm_handle_isr_attribute },
-  { "interrupt",    0, 1, false, false, false, arm_handle_isr_attribute },
-  { "naked",        0, 0, true,  false, false, arm_handle_fndecl_attribute },
+  { "isr",          0, 1, false, false, false, arm_handle_isr_attribute,
+    false },
+  { "interrupt",    0, 1, false, false, false, arm_handle_isr_attribute,
+    false },
+  { "naked",        0, 0, true,  false, false, arm_handle_fndecl_attribute,
+    false },
 #ifdef ARM_PE
   /* ARM/PE has three new attributes:
      interfacearm - ?
@@ -279,15 +284,17 @@ static const struct attribute_spec arm_a
      them with spaces.  We do NOT support this.  Instead, use __declspec
      multiple times.
   */
-  { "dllimport",    0, 0, true,  false, false, NULL },
-  { "dllexport",    0, 0, true,  false, false, NULL },
-  { "interfacearm", 0, 0, true,  false, false, arm_handle_fndecl_attribute },
+  { "dllimport",    0, 0, true,  false, false, NULL, false },
+  { "dllexport",    0, 0, true,  false, false, NULL, false },
+  { "interfacearm", 0, 0, true,  false, false, arm_handle_fndecl_attribute,
+    false },
 #elif TARGET_DLLIMPORT_DECL_ATTRIBUTES
-  { "dllimport",    0, 0, false, false, false, handle_dll_attribute },
-  { "dllexport",    0, 0, false, false, false, handle_dll_attribute },
-  { "notshared",    0, 0, false, true, false, arm_handle_notshared_attribute },
+  { "dllimport",    0, 0, false, false, false, handle_dll_attribute, false },
+  { "dllexport",    0, 0, false, false, false, handle_dll_attribute, false },
+  { "notshared",    0, 0, false, true, false, arm_handle_notshared_attribute,
+    false },
 #endif
-  { NULL,           0, 0, false, false, false, NULL }
+  { NULL,           0, 0, false, false, false, NULL, false }
 };
 
 /* Set default optimization options.  */
Index: gcc/gcc/config/avr/avr.c
===================================================================
--- gcc.orig/gcc/config/avr/avr.c	2010-12-01 17:52:53.000000000 +0100
+++ gcc/gcc/config/avr/avr.c	2011-01-01 14:32:15.654481400 +0100
@@ -123,14 +123,21 @@ section *progmem_section;
 /* AVR attributes.  */
 static const struct attribute_spec avr_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "progmem",   0, 0, false, false, false,  avr_handle_progmem_attribute },
-  { "signal",    0, 0, true,  false, false,  avr_handle_fndecl_attribute },
-  { "interrupt", 0, 0, true,  false, false,  avr_handle_fndecl_attribute },
-  { "naked",     0, 0, false, true,  true,   avr_handle_fntype_attribute },
-  { "OS_task",   0, 0, false, true,  true,   avr_handle_fntype_attribute },
-  { "OS_main",   0, 0, false, true,  true,   avr_handle_fntype_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "progmem",   0, 0, false, false, false,  avr_handle_progmem_attribute,
+    false },
+  { "signal",    0, 0, true,  false, false,  avr_handle_fndecl_attribute,
+    false },
+  { "interrupt", 0, 0, true,  false, false,  avr_handle_fndecl_attribute,
+    false },
+  { "naked",     0, 0, false, true,  true,   avr_handle_fntype_attribute,
+    false },
+  { "OS_task",   0, 0, false, true,  true,   avr_handle_fntype_attribute,
+    false },
+  { "OS_main",   0, 0, false, true,  true,   avr_handle_fntype_attribute,
+    false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
Index: gcc/gcc/config/bfin/bfin.c
===================================================================
--- gcc.orig/gcc/config/bfin/bfin.c	2010-12-08 08:20:50.000000000 +0100
+++ gcc/gcc/config/bfin/bfin.c	2011-01-01 14:34:46.577113700 +0100
@@ -5765,21 +5765,30 @@ bfin_handle_l2_attribute (tree *node, tr
 /* Table of valid machine attributes.  */
 static const struct attribute_spec bfin_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt_handler", 0, 0, false, true,  true, handle_int_attribute },
-  { "exception_handler", 0, 0, false, true,  true, handle_int_attribute },
-  { "nmi_handler", 0, 0, false, true,  true, handle_int_attribute },
-  { "nesting", 0, 0, false, true,  true, NULL },
-  { "kspisusp", 0, 0, false, true,  true, NULL },
-  { "saveall", 0, 0, false, true,  true, NULL },
-  { "longcall",  0, 0, false, true,  true,  bfin_handle_longcall_attribute },
-  { "shortcall", 0, 0, false, true,  true,  bfin_handle_longcall_attribute },
-  { "l1_text", 0, 0, true, false, false,  bfin_handle_l1_text_attribute },
-  { "l1_data", 0, 0, true, false, false,  bfin_handle_l1_data_attribute },
-  { "l1_data_A", 0, 0, true, false, false, bfin_handle_l1_data_attribute },
-  { "l1_data_B", 0, 0, true, false, false,  bfin_handle_l1_data_attribute },
-  { "l2", 0, 0, true, false, false,  bfin_handle_l2_attribute },
-  { NULL, 0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "interrupt_handler", 0, 0, false, true,  true, handle_int_attribute,
+    false },
+  { "exception_handler", 0, 0, false, true,  true, handle_int_attribute,
+    false },
+  { "nmi_handler", 0, 0, false, true,  true, handle_int_attribute, false },
+  { "nesting", 0, 0, false, true,  true, NULL, false },
+  { "kspisusp", 0, 0, false, true,  true, NULL, false },
+  { "saveall", 0, 0, false, true,  true, NULL, false },
+  { "longcall",  0, 0, false, true,  true,  bfin_handle_longcall_attribute,
+    false },
+  { "shortcall", 0, 0, false, true,  true,  bfin_handle_longcall_attribute,
+    false },
+  { "l1_text", 0, 0, true, false, false,  bfin_handle_l1_text_attribute,
+    false },
+  { "l1_data", 0, 0, true, false, false,  bfin_handle_l1_data_attribute,
+    false },
+  { "l1_data_A", 0, 0, true, false, false, bfin_handle_l1_data_attribute,
+    false },
+  { "l1_data_B", 0, 0, true, false, false,  bfin_handle_l1_data_attribute,
+    false },
+  { "l2", 0, 0, true, false, false,  bfin_handle_l2_attribute, false },
+  { NULL, 0, 0, false, false, false, NULL, false }
 };
 \f
 /* Implementation of TARGET_ASM_INTEGER.  When using FD-PIC, we need to
Index: gcc/gcc/config/crx/crx.c
===================================================================
--- gcc.orig/gcc/config/crx/crx.c	2010-12-01 17:52:53.000000000 +0100
+++ gcc/gcc/config/crx/crx.c	2011-01-01 14:36:03.530515100 +0100
@@ -183,8 +183,8 @@ static void crx_function_arg_advance (CU
 
 static const struct attribute_spec crx_attribute_table[] = {
   /* ISRs have special prologue and epilogue requirements. */
-  {"interrupt", 0, 0, false, true, true, NULL},
-  {NULL, 0, 0, false, false, false, NULL}
+  {"interrupt", 0, 0, false, true, true, NULL, false},
+  {NULL, 0, 0, false, false, false, NULL, false}
 };
 
 /* Option handling.  */
Index: gcc/gcc/config/darwin.h
===================================================================
--- gcc.orig/gcc/config/darwin.h	2010-12-24 11:42:22.000000000 +0100
+++ gcc/gcc/config/darwin.h	2011-01-01 15:33:25.812402400 +0100
@@ -717,11 +717,12 @@ extern GTY(()) section * darwin_sections
 
 /* Extra attributes for Darwin.  */
 #define SUBTARGET_ATTRIBUTE_TABLE					     \
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ \
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,     \
+       on_diagnostic } */						     \
   { "apple_kext_compatibility", 0, 0, false, true, false,		     \
-    darwin_handle_kext_attribute },					     \
+    darwin_handle_kext_attribute, false },				     \
   { "weak_import", 0, 0, true, false, false,				     \
-    darwin_handle_weak_import_attribute }
+    darwin_handle_weak_import_attribute, false }
 
 #undef ASM_GENERATE_INTERNAL_LABEL
 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)	\
Index: gcc/gcc/config/h8300/h8300.c
===================================================================
--- gcc.orig/gcc/config/h8300/h8300.c	2010-12-01 17:52:57.000000000 +0100
+++ gcc/gcc/config/h8300/h8300.c	2011-01-01 14:39:30.206336300 +0100
@@ -5367,15 +5367,23 @@ h8300_insert_attributes (tree node, tree
 
 static const struct attribute_spec h8300_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt_handler", 0, 0, true,  false, false, h8300_handle_fndecl_attribute },
-  { "saveall",           0, 0, true,  false, false, h8300_handle_fndecl_attribute },
-  { "OS_Task",           0, 0, true,  false, false, h8300_handle_fndecl_attribute },
-  { "monitor",           0, 0, true,  false, false, h8300_handle_fndecl_attribute },
-  { "function_vector",   0, 0, true,  false, false, h8300_handle_fndecl_attribute },
-  { "eightbit_data",     0, 0, true,  false, false, h8300_handle_eightbit_data_attribute },
-  { "tiny_data",         0, 0, true,  false, false, h8300_handle_tiny_data_attribute },
-  { NULL,                0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "interrupt_handler", 0, 0, true,  false, false,
+    h8300_handle_fndecl_attribute, false },
+  { "saveall",           0, 0, true,  false, false,
+    h8300_handle_fndecl_attribute, false },
+  { "OS_Task",           0, 0, true,  false, false,
+    h8300_handle_fndecl_attribute, false },
+  { "monitor",           0, 0, true,  false, false,
+    h8300_handle_fndecl_attribute, false },
+  { "function_vector",   0, 0, true,  false, false,
+    h8300_handle_fndecl_attribute, false },
+  { "eightbit_data",     0, 0, true,  false, false,
+    h8300_handle_eightbit_data_attribute, false },
+  { "tiny_data",         0, 0, true,  false, false,
+    h8300_handle_tiny_data_attribute, false },
+  { NULL,                0, 0, false, false, false, NULL, false }
 };
 
 
Index: gcc/gcc/config/i386/cygming.h
===================================================================
--- gcc.orig/gcc/config/i386/cygming.h	2010-12-17 21:52:40.000000000 +0100
+++ gcc/gcc/config/i386/cygming.h	2011-01-01 15:34:40.442671000 +0100
@@ -454,8 +454,10 @@ do {						\
 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL))
 
 #define SUBTARGET_ATTRIBUTE_TABLE \
-  { "selectany", 0, 0, true, false, false, ix86_handle_selectany_attribute }
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  { "selectany", 0, 0, true, false, false, ix86_handle_selectany_attribute, \
+    false }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
 
 /*  mcount() does not need a counter variable.  */
 #undef NO_PROFILE_COUNTERS
Index: gcc/gcc/config/i386/i386.c
===================================================================
--- gcc.orig/gcc/config/i386/i386.c	2010-12-31 11:40:31.000000000 +0100
+++ gcc/gcc/config/i386/i386.c	2011-01-01 14:51:41.932188600 +0100
@@ -32270,45 +32270,56 @@ ix86_expand_round (rtx operand0, rtx ope
 /* Table of valid machine attributes.  */
 static const struct attribute_spec ix86_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
   /* Stdcall attribute says callee is responsible for popping arguments
      if they are not variable.  */
-  { "stdcall",   0, 0, false, true,  true,  ix86_handle_cconv_attribute },
+  { "stdcall",   0, 0, false, true,  true,  ix86_handle_cconv_attribute,
+    true },
   /* Fastcall attribute says callee is responsible for popping arguments
      if they are not variable.  */
-  { "fastcall",  0, 0, false, true,  true,  ix86_handle_cconv_attribute },
+  { "fastcall",  0, 0, false, true,  true,  ix86_handle_cconv_attribute,
+    true },
   /* Thiscall attribute says callee is responsible for popping arguments
      if they are not variable.  */
-  { "thiscall",  0, 0, false, true,  true,  ix86_handle_cconv_attribute },
+  { "thiscall",  0, 0, false, true,  true,  ix86_handle_cconv_attribute,
+    true },
   /* Cdecl attribute says the callee is a normal C declaration */
-  { "cdecl",     0, 0, false, true,  true,  ix86_handle_cconv_attribute },
+  { "cdecl",     0, 0, false, true,  true,  ix86_handle_cconv_attribute,
+    true },
   /* Regparm attribute specifies how many integer arguments are to be
      passed in registers.  */
-  { "regparm",   1, 1, false, true,  true,  ix86_handle_cconv_attribute },
+  { "regparm",   1, 1, false, true,  true,  ix86_handle_cconv_attribute,
+    true },
   /* Sseregparm attribute says we are using x86_64 calling conventions
      for FP arguments.  */
-  { "sseregparm", 0, 0, false, true, true, ix86_handle_cconv_attribute },
+  { "sseregparm", 0, 0, false, true, true, ix86_handle_cconv_attribute,
+    true },
   /* force_align_arg_pointer says this function realigns the stack at entry.  */
   { (const char *)&ix86_force_align_arg_pointer_string, 0, 0,
-    false, true,  true, ix86_handle_cconv_attribute },
+    false, true,  true, ix86_handle_cconv_attribute, false },
 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
-  { "dllimport", 0, 0, false, false, false, handle_dll_attribute },
-  { "dllexport", 0, 0, false, false, false, handle_dll_attribute },
-  { "shared",    0, 0, true,  false, false, ix86_handle_shared_attribute },
+  { "dllimport", 0, 0, false, false, false, handle_dll_attribute, false },
+  { "dllexport", 0, 0, false, false, false, handle_dll_attribute, false },
+  { "shared",    0, 0, true,  false, false, ix86_handle_shared_attribute,
+    false },
 #endif
-  { "ms_struct", 0, 0, false, false,  false, ix86_handle_struct_attribute },
-  { "gcc_struct", 0, 0, false, false,  false, ix86_handle_struct_attribute },
+  { "ms_struct", 0, 0, false, false,  false, ix86_handle_struct_attribute,
+    false },
+  { "gcc_struct", 0, 0, false, false,  false, ix86_handle_struct_attribute,
+    false },
 #ifdef SUBTARGET_ATTRIBUTE_TABLE
   SUBTARGET_ATTRIBUTE_TABLE,
 #endif
   /* ms_abi and sysv_abi calling convention function attributes.  */
-  { "ms_abi", 0, 0, false, true, true, ix86_handle_abi_attribute },
-  { "sysv_abi", 0, 0, false, true, true, ix86_handle_abi_attribute },
-  { "ms_hook_prologue", 0, 0, true, false, false, ix86_handle_fndecl_attribute },
+  { "ms_abi", 0, 0, false, true, true, ix86_handle_abi_attribute, true },
+  { "sysv_abi", 0, 0, false, true, true, ix86_handle_abi_attribute, true },
+  { "ms_hook_prologue", 0, 0, true, false, false, ix86_handle_fndecl_attribute,
+    false },
   { "callee_pop_aggregate_return", 1, 1, false, true, true,
-    ix86_handle_callee_pop_aggregate_return },
+    ix86_handle_callee_pop_aggregate_return, true },
   /* End element.  */
-  { NULL,        0, 0, false, false, false, NULL }
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 /* Implement targetm.vectorize.builtin_vectorization_cost.  */
Index: gcc/gcc/config/ia64/ia64.c
===================================================================
--- gcc.orig/gcc/config/ia64/ia64.c	2010-12-30 12:43:40.000000000 +0100
+++ gcc/gcc/config/ia64/ia64.c	2011-01-01 14:56:10.170531000 +0100
@@ -342,15 +342,18 @@ static section * ia64_hpux_function_sect
 /* Table of valid machine attributes.  */
 static const struct attribute_spec ia64_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "syscall_linkage", 0, 0, false, true,  true,  NULL },
-  { "model",	       1, 1, true, false, false, ia64_handle_model_attribute },
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "syscall_linkage", 0, 0, false, true,  true,  NULL, false },
+  { "model",	       1, 1, true, false, false, ia64_handle_model_attribute,
+    false },
 #if TARGET_ABI_OPEN_VMS
-  { "common_object",   1, 1, true, false, false, ia64_vms_common_object_attribute},
+  { "common_object",   1, 1, true, false, false,
+    ia64_vms_common_object_attribute, false },
 #endif
   { "version_id",      1, 1, true, false, false,
-    ia64_handle_version_id_attribute },
-  { NULL,	       0, 0, false, false, false, NULL }
+    ia64_handle_version_id_attribute, false },
+  { NULL,	       0, 0, false, false, false, NULL, false }
 };
 
 /* Implement overriding of the optimization options.  */
Index: gcc/gcc/config/m32c/m32c.c
===================================================================
--- gcc.orig/gcc/config/m32c/m32c.c	2010-12-01 17:52:51.000000000 +0100
+++ gcc/gcc/config/m32c/m32c.c	2011-01-01 14:57:29.201051300 +0100
@@ -3226,11 +3226,12 @@ current_function_special_page_vector (rt
 #undef TARGET_ATTRIBUTE_TABLE
 #define TARGET_ATTRIBUTE_TABLE m32c_attribute_table
 static const struct attribute_spec m32c_attribute_table[] = {
-  {"interrupt", 0, 0, false, false, false, interrupt_handler},
-  {"bank_switch", 0, 0, false, false, false, interrupt_handler},
-  {"fast_interrupt", 0, 0, false, false, false, interrupt_handler},
-  {"function_vector", 1, 1, true,  false, false, function_vector_handler},
-  {0, 0, 0, 0, 0, 0, 0}
+  {"interrupt", 0, 0, false, false, false, interrupt_handler, false},
+  {"bank_switch", 0, 0, false, false, false, interrupt_handler, false},
+  {"fast_interrupt", 0, 0, false, false, false, interrupt_handler, false},
+  {"function_vector", 1, 1, true,  false, false, function_vector_handler,
+   false},
+  {0, 0, 0, 0, 0, 0, 0, false}
 };
 
 #undef TARGET_COMP_TYPE_ATTRIBUTES
Index: gcc/gcc/config/m32r/m32r.c
===================================================================
--- gcc.orig/gcc/config/m32r/m32r.c	2010-12-01 17:52:52.000000000 +0100
+++ gcc/gcc/config/m32r/m32r.c	2011-01-01 14:58:33.612735400 +0100
@@ -107,10 +107,12 @@ static void m32r_trampoline_init (rtx, t
 
 static const struct attribute_spec m32r_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt", 0, 0, true,  false, false, NULL },
-  { "model",     1, 1, true,  false, false, m32r_handle_model_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "interrupt", 0, 0, true,  false, false, NULL, false },
+  { "model",     1, 1, true,  false, false, m32r_handle_model_attribute,
+    false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 static const struct default_options m32r_option_optimization_table[] =
Index: gcc/gcc/config/m68hc11/m68hc11.c
===================================================================
--- gcc.orig/gcc/config/m68hc11/m68hc11.c	2010-12-01 17:52:53.000000000 +0100
+++ gcc/gcc/config/m68hc11/m68hc11.c	2011-01-01 15:00:54.624800900 +0100
@@ -231,13 +231,19 @@ static const struct processor_costs m681
 
 static const struct attribute_spec m68hc11_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt", 0, 0, false, true,  true,  m68hc11_handle_fntype_attribute },
-  { "trap",      0, 0, false, true,  true,  m68hc11_handle_fntype_attribute },
-  { "far",       0, 0, false, true,  true,  m68hc11_handle_fntype_attribute },
-  { "near",      0, 0, false, true,  true,  m68hc11_handle_fntype_attribute },
-  { "page0",     0, 0, false, false, false, m68hc11_handle_page0_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "interrupt", 0, 0, false, true,  true,  m68hc11_handle_fntype_attribute,
+    false },
+  { "trap",      0, 0, false, true,  true,  m68hc11_handle_fntype_attribute,
+    false },
+  { "far",       0, 0, false, true,  true,  m68hc11_handle_fntype_attribute,
+    false },
+  { "near",      0, 0, false, true,  true,  m68hc11_handle_fntype_attribute,
+    false },
+  { "page0",     0, 0, false, false, false, m68hc11_handle_page0_attribute,
+    false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 \f
 /* Initialize the GCC target structure.  */
Index: gcc/gcc/config/m68k/m68k.c
===================================================================
--- gcc.orig/gcc/config/m68k/m68k.c	2010-12-17 21:52:45.000000000 +0100
+++ gcc/gcc/config/m68k/m68k.c	2011-01-01 15:02:39.392793200 +0100
@@ -298,11 +298,15 @@ const char *m68k_library_id_string = "_c
 
 static const struct attribute_spec m68k_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt", 0, 0, true,  false, false, m68k_handle_fndecl_attribute },
-  { "interrupt_handler", 0, 0, true,  false, false, m68k_handle_fndecl_attribute },
-  { "interrupt_thread", 0, 0, true,  false, false, m68k_handle_fndecl_attribute },
-  { NULL,                0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "interrupt", 0, 0, true,  false, false, m68k_handle_fndecl_attribute,
+    false },
+  { "interrupt_handler", 0, 0, true,  false, false,
+    m68k_handle_fndecl_attribute, false },
+  { "interrupt_thread", 0, 0, true,  false, false,
+    m68k_handle_fndecl_attribute, false },
+  { NULL,                0, 0, false, false, false, NULL, false }
 };
 
 struct gcc_target targetm = TARGET_INITIALIZER;
Index: gcc/gcc/config/mcore/mcore.c
===================================================================
--- gcc.orig/gcc/config/mcore/mcore.c	2010-12-08 08:20:49.000000000 +0100
+++ gcc/gcc/config/mcore/mcore.c	2011-01-01 15:03:55.990174400 +0100
@@ -156,11 +156,13 @@ static void       mcore_option_override
 
 static const struct attribute_spec mcore_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "dllexport", 0, 0, true,  false, false, NULL },
-  { "dllimport", 0, 0, true,  false, false, NULL },
-  { "naked",     0, 0, true,  false, false, mcore_handle_naked_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "dllexport", 0, 0, true,  false, false, NULL, false },
+  { "dllimport", 0, 0, true,  false, false, NULL, false },
+  { "naked",     0, 0, true,  false, false, mcore_handle_naked_attribute,
+    false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 /* What options are we going to default to specific settings when
Index: gcc/gcc/config/mep/mep.c
===================================================================
--- gcc.orig/gcc/config/mep/mep.c	2010-12-24 11:42:15.000000000 +0100
+++ gcc/gcc/config/mep/mep.c	2011-01-01 15:06:04.561528200 +0100
@@ -4088,17 +4088,19 @@ mep_validate_vliw (tree *node, tree name
 
 static const struct attribute_spec mep_attribute_table[11] =
 {
-  /* name         min max decl   type   func   handler */
-  { "based",        0, 0, false, false, false, mep_validate_based_tiny },
-  { "tiny",         0, 0, false, false, false, mep_validate_based_tiny },
-  { "near",         0, 0, false, false, false, mep_validate_near_far },
-  { "far",          0, 0, false, false, false, mep_validate_near_far },
-  { "disinterrupt", 0, 0, false, false, false, mep_validate_disinterrupt },
-  { "interrupt",    0, 0, false, false, false, mep_validate_interrupt },
-  { "io",           0, 1, false, false, false, mep_validate_io_cb },
-  { "cb",           0, 1, false, false, false, mep_validate_io_cb },
-  { "vliw",         0, 0, false, true,  false, mep_validate_vliw },
-  { NULL,           0, 0, false, false, false, NULL }
+  /* name         min max decl   type   func   handler
+     on_diagnostic */
+  { "based",        0, 0, false, false, false, mep_validate_based_tiny, false },
+  { "tiny",         0, 0, false, false, false, mep_validate_based_tiny, false },
+  { "near",         0, 0, false, false, false, mep_validate_near_far, false },
+  { "far",          0, 0, false, false, false, mep_validate_near_far, false },
+  { "disinterrupt", 0, 0, false, false, false, mep_validate_disinterrupt,
+    false },
+  { "interrupt",    0, 0, false, false, false, mep_validate_interrupt, false },
+  { "io",           0, 1, false, false, false, mep_validate_io_cb, false },
+  { "cb",           0, 1, false, false, false, mep_validate_io_cb, false },
+  { "vliw",         0, 0, false, true,  false, mep_validate_vliw, false },
+  { NULL,           0, 0, false, false, false, NULL, false }
 };
 
 static bool
Index: gcc/gcc/config/microblaze/microblaze.c
===================================================================
--- gcc.orig/gcc/config/microblaze/microblaze.c	2010-12-01 17:52:53.000000000 +0100
+++ gcc/gcc/config/microblaze/microblaze.c	2011-01-01 15:07:25.586162600 +0100
@@ -195,10 +195,14 @@ int interrupt_handler;
 int save_volatiles;
 
 const struct attribute_spec microblaze_attribute_table[] = {
-  /* name         min_len, max_len, decl_req, type_req, fn_type, req_handler */
-  {"interrupt_handler", 0,       0,     true,    false,   false,        NULL},
-  {"save_volatiles"   , 0,       0,     true,    false,   false,        NULL},
-  { NULL,        	0,       0,    false,    false,   false,        NULL}
+  /* name         min_len, max_len, decl_req, type_req, fn_type, req_handler,
+     on_diagnostic */
+  {"interrupt_handler", 0,       0,     true,    false,   false,        NULL,
+    false },
+  {"save_volatiles"   , 0,       0,     true,    false,   false,        NULL,
+    false },
+  { NULL,        	0,       0,    false,    false,   false,        NULL,
+    false }
 };
 
 static int microblaze_interrupt_function_p (tree);
Index: gcc/gcc/config/mips/mips.c
===================================================================
--- gcc.orig/gcc/config/mips/mips.c	2010-12-31 11:40:31.000000000 +0100
+++ gcc/gcc/config/mips/mips.c	2011-01-01 15:09:10.658172300 +0100
@@ -640,22 +640,23 @@ const enum reg_class mips_regno_to_class
 
 /* The value of TARGET_ATTRIBUTE_TABLE.  */
 static const struct attribute_spec mips_attribute_table[] = {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "long_call",   0, 0, false, true,  true,  NULL },
-  { "far",     	   0, 0, false, true,  true,  NULL },
-  { "near",        0, 0, false, true,  true,  NULL },
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       om_diagnostic } */
+  { "long_call",   0, 0, false, true,  true,  NULL, false },
+  { "far",     	   0, 0, false, true,  true,  NULL, false },
+  { "near",        0, 0, false, true,  true,  NULL, false },
   /* We would really like to treat "mips16" and "nomips16" as type
      attributes, but GCC doesn't provide the hooks we need to support
      the right conversion rules.  As declaration attributes, they affect
      code generation but don't carry other semantics.  */
-  { "mips16", 	   0, 0, true,  false, false, NULL },
-  { "nomips16",    0, 0, true,  false, false, NULL },
+  { "mips16", 	   0, 0, true,  false, false, NULL, false },
+  { "nomips16",    0, 0, true,  false, false, NULL, false },
   /* Allow functions to be specified as interrupt handlers */
-  { "interrupt",   0, 0, false, true,  true, NULL },
-  { "use_shadow_register_set",	0, 0, false, true,  true, NULL },
-  { "keep_interrupts_masked",	0, 0, false, true,  true, NULL },
-  { "use_debug_exception_return", 0, 0, false, true,  true, NULL },
-  { NULL,	   0, 0, false, false, false, NULL }
+  { "interrupt",   0, 0, false, true,  true, NULL, false },
+  { "use_shadow_register_set",	0, 0, false, true,  true, NULL, false },
+  { "keep_interrupts_masked",	0, 0, false, true,  true, NULL, false },
+  { "use_debug_exception_return", 0, 0, false, true,  true, NULL, false },
+  { NULL,	   0, 0, false, false, false, NULL, false }
 };
 \f
 /* A table describing all the processors GCC knows about.  Names are
Index: gcc/gcc/config/rs6000/rs6000.c
===================================================================
--- gcc.orig/gcc/config/rs6000/rs6000.c	2010-12-31 18:05:51.000000000 +0100
+++ gcc/gcc/config/rs6000/rs6000.c	2011-01-01 15:11:11.981111600 +0100
@@ -1295,16 +1295,22 @@ static const char alt_reg_names[][8] =
 
 static const struct attribute_spec rs6000_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "altivec",   1, 1, false, true,  false, rs6000_handle_altivec_attribute },
-  { "longcall",  0, 0, false, true,  true,  rs6000_handle_longcall_attribute },
-  { "shortcall", 0, 0, false, true,  true,  rs6000_handle_longcall_attribute },
-  { "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute },
-  { "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute },
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "altivec",   1, 1, false, true,  false, rs6000_handle_altivec_attribute,
+    false },
+  { "longcall",  0, 0, false, true,  true,  rs6000_handle_longcall_attribute,
+    false },
+  { "shortcall", 0, 0, false, true,  true,  rs6000_handle_longcall_attribute,
+    false },
+  { "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
+    false },
+  { "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
+    false },
 #ifdef SUBTARGET_ATTRIBUTE_TABLE
   SUBTARGET_ATTRIBUTE_TABLE,
 #endif
-  { NULL,        0, 0, false, false, false, NULL }
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
Index: gcc/gcc/config/rx/rx.c
===================================================================
--- gcc.orig/gcc/config/rx/rx.c	2010-11-27 12:31:40.000000000 +0100
+++ gcc/gcc/config/rx/rx.c	2011-01-01 15:13:36.845397400 +0100
@@ -2159,11 +2159,15 @@ rx_handle_func_attribute (tree * node,
 /* Table of RX specific attributes.  */
 const struct attribute_spec rx_attribute_table[] =
 {
-  /* Name, min_len, max_len, decl_req, type_req, fn_type_req, handler.  */
-  { "fast_interrupt", 0, 0, true, false, false, rx_handle_func_attribute },
-  { "interrupt",      0, 0, true, false, false, rx_handle_func_attribute },
-  { "naked",          0, 0, true, false, false, rx_handle_func_attribute },
-  { NULL,             0, 0, false, false, false, NULL }
+  /* Name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+     on_diagnostic.  */
+  { "fast_interrupt", 0, 0, true, false, false, rx_handle_func_attribute,
+    false },
+  { "interrupt",      0, 0, true, false, false, rx_handle_func_attribute,
+    false },
+  { "naked",          0, 0, true, false, false, rx_handle_func_attribute,
+    false },
+  { NULL,             0, 0, false, false, false, NULL, false }
 };
 
 /* Extra processing for target specific command line options.  */
Index: gcc/gcc/config/sh/sh.c
===================================================================
--- gcc.orig/gcc/config/sh/sh.c	2010-12-24 11:42:15.000000000 +0100
+++ gcc/gcc/config/sh/sh.c	2011-01-01 15:16:36.349664400 +0100
@@ -306,15 +306,24 @@ static void sh_conditional_register_usag
 \f
 static const struct attribute_spec sh_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt_handler", 0, 0, true,  false, false, sh_handle_interrupt_handler_attribute },
-  { "sp_switch",         1, 1, true,  false, false, sh_handle_sp_switch_attribute },
-  { "trap_exit",         1, 1, true,  false, false, sh_handle_trap_exit_attribute },
-  { "renesas",           0, 0, false, true, false, sh_handle_renesas_attribute },
-  { "trapa_handler",     0, 0, true,  false, false, sh_handle_interrupt_handler_attribute },
-  { "nosave_low_regs",   0, 0, true,  false, false, sh_handle_interrupt_handler_attribute },
-  { "resbank",           0, 0, true,  false, false, sh_handle_resbank_handler_attribute },
-  { "function_vector",   1, 1, true,  false, false, sh2a_handle_function_vector_handler_attribute },
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "interrupt_handler", 0, 0, true,  false, false,
+    sh_handle_interrupt_handler_attribute, false },
+  { "sp_switch",         1, 1, true,  false, false,
+     sh_handle_sp_switch_attribute, false },
+  { "trap_exit",         1, 1, true,  false, false,
+    sh_handle_trap_exit_attribute, false },
+  { "renesas",           0, 0, false, true, false,
+    sh_handle_renesas_attribute, false },
+  { "trapa_handler",     0, 0, true,  false, false,
+    sh_handle_interrupt_handler_attribute, false },
+  { "nosave_low_regs",   0, 0, true,  false, false,
+    sh_handle_interrupt_handler_attribute, false },
+  { "resbank",           0, 0, true,  false, false,
+    sh_handle_resbank_handler_attribute, false },
+  { "function_vector",   1, 1, true,  false, false,
+    sh2a_handle_function_vector_handler_attribute, false },
 #ifdef SYMBIAN
   /* Symbian support adds three new attributes:
      dllexport - for exporting a function/variable that will live in a dll
@@ -323,10 +332,12 @@ static const struct attribute_spec sh_at
      Microsoft allows multiple declspecs in one __declspec, separating
      them with spaces.  We do NOT support this.  Instead, use __declspec
      multiple times.  */
-  { "dllimport",         0, 0, true,  false, false, sh_symbian_handle_dll_attribute },
-  { "dllexport",         0, 0, true,  false, false, sh_symbian_handle_dll_attribute },
+  { "dllimport",         0, 0, true,  false, false,
+    sh_symbian_handle_dll_attribute, false },
+  { "dllexport",         0, 0, true,  false, false,
+    sh_symbian_handle_dll_attribute, false },
 #endif
-  { NULL,                0, 0, false, false, false, NULL }
+  { NULL,                0, 0, false, false, false, NULL, false }
 };
 
 /* Set default optimization options.  */
Index: gcc/gcc/config/sol2.h
===================================================================
--- gcc.orig/gcc/config/sol2.h	2010-12-24 11:42:22.000000000 +0100
+++ gcc/gcc/config/sol2.h	2011-01-01 14:54:13.378850900 +0100
@@ -258,8 +258,8 @@ __enable_execute_stack (void *addr)
 /* #pragma init and #pragma fini are implemented on top of init and
    fini attributes.  */
 #define SOLARIS_ATTRIBUTE_TABLE						\
-  { "init",      0, 0, true,  false,  false, NULL },			\
-  { "fini",      0, 0, true,  false,  false, NULL }
+  { "init",      0, 0, true,  false,  false, NULL, false },		\
+  { "fini",      0, 0, true,  false,  false, NULL, false }
 
 /* Solaris/x86 as and gas support the common ELF .section/.pushsection
    syntax.  */
Index: gcc/gcc/config/sparc/sparc.c
===================================================================
--- gcc.orig/gcc/config/sparc/sparc.c	2010-12-31 11:40:30.000000000 +0100
+++ gcc/gcc/config/sparc/sparc.c	2011-01-01 15:24:18.240083100 +0100
@@ -475,9 +475,10 @@ static enum machine_mode sparc_preferred
 /* Table of valid machine attributes.  */
 static const struct attribute_spec sparc_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       do_diagnostic } */
   SUBTARGET_ATTRIBUTE_TABLE,
-  { NULL,        0, 0, false, false, false, NULL }
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 #endif
 \f
Index: gcc/gcc/config/spu/spu.c
===================================================================
--- gcc.orig/gcc/config/spu/spu.c	2010-12-24 11:42:14.000000000 +0100
+++ gcc/gcc/config/spu/spu.c	2011-01-01 15:25:33.897410400 +0100
@@ -292,10 +292,13 @@ spu_libgcc_shift_count_mode (void);
 /*  Table of machine attributes.  */
 static const struct attribute_spec spu_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "naked",          0, 0, true,  false, false, spu_handle_fndecl_attribute },
-  { "spu_vector",     0, 0, false, true,  false, spu_handle_vector_attribute },
-  { NULL,             0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "naked",          0, 0, true,  false, false, spu_handle_fndecl_attribute,
+    false },
+  { "spu_vector",     0, 0, false, true,  false, spu_handle_vector_attribute,
+    false },
+  { NULL,             0, 0, false, false, false, NULL, false }
 };
 \f
 /*  TARGET overrides.  */
Index: gcc/gcc/config/stormy16/stormy16.c
===================================================================
--- gcc.orig/gcc/config/stormy16/stormy16.c	2010-12-01 17:52:53.000000000 +0100
+++ gcc/gcc/config/stormy16/stormy16.c	2011-01-01 15:26:58.578253900 +0100
@@ -2201,11 +2201,15 @@ static tree xstormy16_handle_below100_at
 
 static const struct attribute_spec xstormy16_attribute_table[] =
 {
-  /* name, min_len, max_len, decl_req, type_req, fn_type_req, handler.  */
-  { "interrupt", 0, 0, false, true,  true,  xstormy16_handle_interrupt_attribute },
-  { "BELOW100",  0, 0, false, false, false, xstormy16_handle_below100_attribute },
-  { "below100",  0, 0, false, false, false, xstormy16_handle_below100_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+     on_diagnostic.  */
+  { "interrupt", 0, 0, false, true,  true,
+    xstormy16_handle_interrupt_attribute , false },
+  { "BELOW100",  0, 0, false, false, false,
+    xstormy16_handle_below100_attribute, false },
+  { "below100",  0, 0, false, false, false,
+    xstormy16_handle_below100_attribute, false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 /* Handle an "interrupt" attribute;
Index: gcc/gcc/config/v850/v850.c
===================================================================
--- gcc.orig/gcc/config/v850/v850.c	2010-12-01 17:52:57.000000000 +0100
+++ gcc/gcc/config/v850/v850.c	2011-01-01 15:28:57.082031900 +0100
@@ -3118,13 +3118,19 @@ v850_issue_rate (void)
 
 static const struct attribute_spec v850_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt_handler", 0, 0, true,  false, false, v850_handle_interrupt_attribute },
-  { "interrupt",         0, 0, true,  false, false, v850_handle_interrupt_attribute },
-  { "sda",               0, 0, true,  false, false, v850_handle_data_area_attribute },
-  { "tda",               0, 0, true,  false, false, v850_handle_data_area_attribute },
-  { "zda",               0, 0, true,  false, false, v850_handle_data_area_attribute },
-  { NULL,                0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "interrupt_handler", 0, 0, true,  false, false,
+    v850_handle_interrupt_attribute, false },
+  { "interrupt",         0, 0, true,  false, false,
+    v850_handle_interrupt_attribute, false },
+  { "sda",               0, 0, true,  false, false,
+    v850_handle_data_area_attribute, false },
+  { "tda",               0, 0, true,  false, false,
+    v850_handle_data_area_attribute, false },
+  { "zda",               0, 0, true,  false, false,
+    v850_handle_data_area_attribute, false },
+  { NULL,                0, 0, false, false, false, NULL, false }
 };
 \f
 /* Initialize the GCC target structure.  */
Index: gcc/gcc/cp/tree.c
===================================================================
--- gcc.orig/gcc/cp/tree.c	2010-12-31 12:34:23.000000000 +0100
+++ gcc/gcc/cp/tree.c	2011-01-01 15:38:44.552633300 +0100
@@ -2574,11 +2574,15 @@ zero_init_p (const_tree t)
 /* Table of valid C++ attributes.  */
 const struct attribute_spec cxx_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "java_interface", 0, 0, false, false, false, handle_java_interface_attribute },
-  { "com_interface",  0, 0, false, false, false, handle_com_interface_attribute },
-  { "init_priority",  1, 1, true,  false, false, handle_init_priority_attribute },
-  { NULL,	      0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
+  { "java_interface", 0, 0, false, false, false,
+    handle_java_interface_attribute, false },
+  { "com_interface",  0, 0, false, false, false,
+    handle_com_interface_attribute, false },
+  { "init_priority",  1, 1, true,  false, false,
+    handle_init_priority_attribute, false },
+  { NULL,	      0, 0, false, false, false, NULL, false }
 };
 
 /* Handle a "java_interface" attribute; arguments as in
Index: gcc/gcc/doc/plugins.texi
===================================================================
--- gcc.orig/gcc/doc/plugins.texi	2010-12-24 11:41:40.000000000 +0100
+++ gcc/gcc/doc/plugins.texi	2011-01-01 15:39:51.265449100 +0100
@@ -331,7 +331,7 @@ handle_user_attribute (tree *node, tree
 
 /* Attribute definition */
 static struct attribute_spec user_attr =
-  @{ "user", 1, 1, false,  false, false, handle_user_attribute @};
+  @{ "user", 1, 1, false,  false, false, handle_user_attribute, false @};
 
 /* Plugin callback called during attribute registration.
 Registered with register_callback (plugin_name, PLUGIN_ATTRIBUTES, register_attributes, NULL)
Index: gcc/gcc/java/lang.c
===================================================================
--- gcc.orig/gcc/java/lang.c	2010-12-17 21:52:01.000000000 +0100
+++ gcc/gcc/java/lang.c	2011-01-01 15:40:51.189876500 +0100
@@ -75,8 +75,8 @@ static tree java_eh_personality (void);
 const struct attribute_spec java_attribute_table[] =
 {
  { "nonnull",                0, -1, false, true, true,
-			      NULL },
-  { NULL,                     0, 0, false, false, false, NULL }
+			      NULL, false },
+  { NULL,                     0, 0, false, false, false, NULL, false }
 };
 
 /* Used to avoid printing error messages with bogus function
Index: gcc/gcc/lto/lto-lang.c
===================================================================
--- gcc.orig/gcc/lto/lto-lang.c	2010-12-24 11:42:01.000000000 +0100
+++ gcc/gcc/lto/lto-lang.c	2011-01-01 15:44:33.671601800 +0100
@@ -51,29 +51,30 @@ static tree handle_format_arg_attribute
 /* Table of machine-independent attributes supported in GIMPLE.  */
 const struct attribute_spec lto_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       do_diagnostic } */
   { "noreturn",               0, 0, true,  false, false,
-			      handle_noreturn_attribute },
+			      handle_noreturn_attribute, false },
   { "leaf",		      0, 0, true,  false, false,
-			      handle_leaf_attribute },
+			      handle_leaf_attribute, false },
   /* The same comments as for noreturn attributes apply to const ones.  */
   { "const",                  0, 0, true,  false, false,
-			      handle_const_attribute },
+			      handle_const_attribute, false },
   { "malloc",                 0, 0, true,  false, false,
-			      handle_malloc_attribute },
+			      handle_malloc_attribute, false },
   { "pure",                   0, 0, true,  false, false,
-			      handle_pure_attribute },
+			      handle_pure_attribute, false },
   { "no vops",                0, 0, true,  false, false,
-			      handle_novops_attribute },
+			      handle_novops_attribute, false },
   { "nonnull",                0, -1, false, true, true,
-			      handle_nonnull_attribute },
+			      handle_nonnull_attribute, false },
   { "nothrow",                0, 0, true,  false, false,
-			      handle_nothrow_attribute },
+			      handle_nothrow_attribute, false },
   { "sentinel",               0, 1, false, true, true,
-			      handle_sentinel_attribute },
+			      handle_sentinel_attribute, false },
   { "type generic",           0, 0, false, true, true,
-			      handle_type_generic_attribute },
-  { NULL,                     0, 0, false, false, false, NULL }
+			      handle_type_generic_attribute, false },
+  { NULL,                     0, 0, false, false, false, NULL, false }
 };
 
 /* Give the specifications for the format attributes, used by C and all
@@ -81,12 +82,13 @@ const struct attribute_spec lto_attribut
 
 const struct attribute_spec lto_format_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       on_diagnostic } */
   { "format",                 3, 3, false, true,  true,
-			      handle_format_attribute },
+			      handle_format_attribute, false },
   { "format_arg",             1, 1, false, true,  true,
-			      handle_format_arg_attribute },
-  { NULL,                     0, 0, false, false, false, NULL }
+			      handle_format_arg_attribute, false },
+  { NULL,                     0, 0, false, false, false, NULL, false }
 };
 
 enum built_in_attribute
Index: gcc/gcc/testsuite/g++.dg/plugin/attribute_plugin.c
===================================================================
--- gcc.orig/gcc/testsuite/g++.dg/plugin/attribute_plugin.c	2010-09-09 16:04:47.000000000 +0200
+++ gcc/gcc/testsuite/g++.dg/plugin/attribute_plugin.c	2011-01-01 15:46:02.477681200 +0100
@@ -26,7 +26,7 @@ handle_user_attribute (tree *node, tree
 /* Attribute definition */
 
 static struct attribute_spec user_attr =
-  { "user", 1, 1, false,  false, false, handle_user_attribute };
+  { "user", 1, 1, false,  false, false, handle_user_attribute, false };
 
 /* Plugin callback called during attribute registration */
 
Index: gcc/gcc/tree.h
===================================================================
--- gcc.orig/gcc/tree.h	2010-12-24 11:42:23.000000000 +0100
+++ gcc/gcc/tree.h	2011-01-01 14:06:03.574563500 +0100
@@ -4330,6 +4330,8 @@ struct attribute_spec
      by the rest of this structure.  */
   tree (*const handler) (tree *node, tree name, tree args,
 				 int flags, bool *no_add_attrs);
+  /* Specifies if attribute gets displayed on diagnostic output.  */
+  const bool on_diagnostic;
 };
 
 /* Flags that may be passed in the third argument of decl_attributes, and

[-- Attachment #3: dispattr2.txt --]
[-- Type: text/plain, Size: 3539 bytes --]

Index: gcc/gcc/c-family/c-pretty-print.c
===================================================================
--- gcc.orig/gcc/c-family/c-pretty-print.c	2010-12-03 19:45:51.000000000 +0100
+++ gcc/gcc/c-family/c-pretty-print.c	2011-01-01 16:48:22.078574100 +0100
@@ -460,6 +460,7 @@ pp_c_specifier_qualifier_list (c_pretty_
 	  {
 	    pp_c_whitespace (pp);
 	    pp_c_left_paren (pp);
+	    pp_c_attributes_display (pp, TYPE_ATTRIBUTES (pointee));
 	  }
 	else if (!c_dialect_cxx ())
 	  pp_c_whitespace (pp);
@@ -790,6 +791,47 @@ pp_c_attributes (c_pretty_printer *pp, t
   pp_c_right_paren (pp);
 }
 
+/* Pretty-print ATTRIBUTES using GNU C extension syntax for attributes
+   marked to be displayed on disgnostic.  */
+
+void
+pp_c_attributes_display (c_pretty_printer *pp, tree a)
+{
+  bool is_first = true;
+
+  if (a == NULL_TREE)
+    return;
+
+  for (; a != NULL_TREE; a = TREE_CHAIN (a))
+    {
+      const struct attribute_spec *as;
+      as = lookup_attribute_spec (TREE_PURPOSE (a));
+      if (!as || as->on_diagnostic == false)
+        continue;
+      if (is_first)
+       {
+         pp_c_ws_string (pp, "__attribute__");
+         pp_c_left_paren (pp);
+         pp_c_left_paren (pp);
+         is_first = false;
+       }
+      else
+       {
+         pp_separate_with (pp, ',');
+       }
+      pp_tree_identifier (pp, TREE_PURPOSE (a));
+      if (TREE_VALUE (a))
+       pp_c_call_argument_list (pp, TREE_VALUE (a));
+    }
+
+  if (!is_first)
+    {
+      pp_c_right_paren (pp);
+      pp_c_right_paren (pp);
+      pp_c_whitespace (pp);
+    }
+}
+
 /* function-definition:
       declaration-specifiers declarator compound-statement  */
 
Index: gcc/gcc/c-family/c-pretty-print.h
===================================================================
--- gcc.orig/gcc/c-family/c-pretty-print.h	2010-09-09 15:59:07.000000000 +0200
+++ gcc/gcc/c-family/c-pretty-print.h	2011-01-01 16:50:12.810907600 +0100
@@ -176,6 +176,7 @@ void pp_c_space_for_pointer_operator (c_
 void pp_c_tree_decl_identifier (c_pretty_printer *, tree);
 void pp_c_function_definition (c_pretty_printer *, tree);
 void pp_c_attributes (c_pretty_printer *, tree);
+void pp_c_attributes_display (c_pretty_printer *, tree);
 void pp_c_cv_qualifiers (c_pretty_printer *pp, int qualifiers, bool func_type);
 void pp_c_type_qualifier_list (c_pretty_printer *, tree);
 void pp_c_parameter_type_list (c_pretty_printer *, tree);
Index: gcc/gcc/cp/cxx-pretty-print.c
===================================================================
--- gcc.orig/gcc/cp/cxx-pretty-print.c	2010-12-31 11:36:43.000000000 +0100
+++ gcc/gcc/cp/cxx-pretty-print.c	2011-01-01 16:55:30.584083200 +0100
@@ -1323,6 +1323,8 @@ pp_cxx_ptr_operator (cxx_pretty_printer
       if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE
 	  || TYPE_PTR_TO_MEMBER_P (TREE_TYPE (t)))
 	pp_cxx_ptr_operator (pp, TREE_TYPE (t));
+      pp_c_attributes_display (pp_c_base (pp),
+			       TYPE_ATTRIBUTES (TREE_TYPE (t)));
       if (TREE_CODE (t) == POINTER_TYPE)
 	{
 	  pp_star (pp);
Index: gcc/gcc/cp/error.c
===================================================================
--- gcc.orig/gcc/cp/error.c	2010-12-31 11:36:42.000000000 +0100
+++ gcc/gcc/cp/error.c	2011-01-01 16:52:03.938263800 +0100
@@ -661,6 +661,8 @@ dump_type_prefix (tree t, int flags)
 	  {
 	    pp_cxx_whitespace (cxx_pp);
 	    pp_cxx_left_paren (cxx_pp);
+	    pp_c_attributes_display (pp_c_base (cxx_pp),
+				     TYPE_ATTRIBUTES (sub));
 	  }
 	if (TREE_CODE (t) == POINTER_TYPE)
 	  pp_character(cxx_pp, '*');

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-01-01 18:07       ` Kai Tietz
@ 2011-01-04 22:37         ` Jason Merrill
  2011-01-05 11:14           ` Richard Guenther
  2011-03-17  8:46           ` Kai Tietz
  0 siblings, 2 replies; 19+ messages in thread
From: Jason Merrill @ 2011-01-04 22:37 UTC (permalink / raw)
  To: Kai Tietz
  Cc: Gabriel Dos Reis, Joseph S. Myers, GCC Patches, Richard Henderson

On 01/01/2011 01:07 PM, Kai Tietz wrote:
> Well, as here no further agreement was found, I post here the
> alternative suggested by Joseph. I am open-minded which approach will
> be chosen. I just want to fix this long pending issue.
> I split up this patch in two parts. The first simply extends the
> struct attribute_spec by new member 'on_diagnostic' and extends the
> the uses of this structure by this new field. This new member
> specifies if the attribute shall be show on diagnostic output, or not.

This seems like a reasonable approach, but I'd prefer to describe/name 
the field as indicating that the attribute affects type compatibility 
(since that's why we want to see the attribute in diagnostics), and 
making the default comp_type_attributes use that information.

Jason

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-01-04 22:37         ` Jason Merrill
@ 2011-01-05 11:14           ` Richard Guenther
  2011-01-05 14:11             ` Jason Merrill
  2011-03-17  8:46           ` Kai Tietz
  1 sibling, 1 reply; 19+ messages in thread
From: Richard Guenther @ 2011-01-05 11:14 UTC (permalink / raw)
  To: Jason Merrill
  Cc: Kai Tietz, Gabriel Dos Reis, Joseph S. Myers, GCC Patches,
	Richard Henderson

On Tue, Jan 4, 2011 at 11:27 PM, Jason Merrill <jason@redhat.com> wrote:
> On 01/01/2011 01:07 PM, Kai Tietz wrote:
>>
>> Well, as here no further agreement was found, I post here the
>> alternative suggested by Joseph. I am open-minded which approach will
>> be chosen. I just want to fix this long pending issue.
>> I split up this patch in two parts. The first simply extends the
>> struct attribute_spec by new member 'on_diagnostic' and extends the
>> the uses of this structure by this new field. This new member
>> specifies if the attribute shall be show on diagnostic output, or not.
>
> This seems like a reasonable approach, but I'd prefer to describe/name the
> field as indicating that the attribute affects type compatibility (since
> that's why we want to see the attribute in diagnostics), and making the
> default comp_type_attributes use that information.

Isn't the decl vs. type attribute flag what is used for this?  If an attribute
can be only applied to types then it (might?) affects type compatibility,
if it can be applied to decls as well then it certainly won't.

Richard.

> Jason
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-01-05 11:14           ` Richard Guenther
@ 2011-01-05 14:11             ` Jason Merrill
  0 siblings, 0 replies; 19+ messages in thread
From: Jason Merrill @ 2011-01-05 14:11 UTC (permalink / raw)
  To: Richard Guenther
  Cc: Kai Tietz, Gabriel Dos Reis, Joseph S. Myers, GCC Patches,
	Richard Henderson

On 01/05/2011 06:10 AM, Richard Guenther wrote:
> On Tue, Jan 4, 2011 at 11:27 PM, Jason Merrill<jason@redhat.com>  wrote:
>>
>> This seems like a reasonable approach, but I'd prefer to describe/name the
>> field as indicating that the attribute affects type compatibility (since
>> that's why we want to see the attribute in diagnostics), and making the
>> default comp_type_attributes use that information.
>
> Isn't the decl vs. type attribute flag what is used for this?  If an attribute
> can be only applied to types then it (might?) affects type compatibility,
> if it can be applied to decls as well then it certainly won't.

Not all type flags affect compatibility; for instance, "format".

Jason

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-01-04 22:37         ` Jason Merrill
  2011-01-05 11:14           ` Richard Guenther
@ 2011-03-17  8:46           ` Kai Tietz
  2011-03-17 15:38             ` Jason Merrill
  1 sibling, 1 reply; 19+ messages in thread
From: Kai Tietz @ 2011-03-17  8:46 UTC (permalink / raw)
  To: Jason Merrill
  Cc: Gabriel Dos Reis, Joseph S. Myers, GCC Patches, Richard Henderson

PING, ok for 4.7?

2011/1/4 Jason Merrill <jason@redhat.com>:
> On 01/01/2011 01:07 PM, Kai Tietz wrote:
>>
>> Well, as here no further agreement was found, I post here the
>> alternative suggested by Joseph. I am open-minded which approach will
>> be chosen. I just want to fix this long pending issue.
>> I split up this patch in two parts. The first simply extends the
>> struct attribute_spec by new member 'on_diagnostic' and extends the
>> the uses of this structure by this new field. This new member
>> specifies if the attribute shall be show on diagnostic output, or not.
>
> This seems like a reasonable approach, but I'd prefer to describe/name the
> field as indicating that the attribute affects type compatibility (since
> that's why we want to see the attribute in diagnostics), and making the
> default comp_type_attributes use that information.
>
> Jason
>



-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-03-17  8:46           ` Kai Tietz
@ 2011-03-17 15:38             ` Jason Merrill
  2011-03-17 16:08               ` Kai Tietz
  0 siblings, 1 reply; 19+ messages in thread
From: Jason Merrill @ 2011-03-17 15:38 UTC (permalink / raw)
  To: Kai Tietz
  Cc: Gabriel Dos Reis, Joseph S. Myers, GCC Patches, Richard Henderson

On 03/17/2011 04:46 AM, Kai Tietz wrote:
> PING, ok for 4.7?

Did you have a response to my comment below?

> 2011/1/4 Jason Merrill<jason@redhat.com>:
>> On 01/01/2011 01:07 PM, Kai Tietz wrote:
>>>
>>> Well, as here no further agreement was found, I post here the
>>> alternative suggested by Joseph. I am open-minded which approach will
>>> be chosen. I just want to fix this long pending issue.
>>> I split up this patch in two parts. The first simply extends the
>>> struct attribute_spec by new member 'on_diagnostic' and extends the
>>> the uses of this structure by this new field. This new member
>>> specifies if the attribute shall be show on diagnostic output, or not.
>>
>> This seems like a reasonable approach, but I'd prefer to describe/name the
>> field as indicating that the attribute affects type compatibility (since
>> that's why we want to see the attribute in diagnostics), and making the
>> default comp_type_attributes use that information.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-03-17 15:38             ` Jason Merrill
@ 2011-03-17 16:08               ` Kai Tietz
  2011-03-17 16:17                 ` Jason Merrill
  0 siblings, 1 reply; 19+ messages in thread
From: Kai Tietz @ 2011-03-17 16:08 UTC (permalink / raw)
  To: Jason Merrill
  Cc: Gabriel Dos Reis, Joseph S. Myers, GCC Patches, Richard Henderson

2011/3/17 Jason Merrill <jason@redhat.com>:
> On 03/17/2011 04:46 AM, Kai Tietz wrote:
>>
>> PING, ok for 4.7?
>
> Did you have a response to my comment below?
>
>> 2011/1/4 Jason Merrill<jason@redhat.com>:
>>>
>>> On 01/01/2011 01:07 PM, Kai Tietz wrote:
>>>>
>>>> Well, as here no further agreement was found, I post here the
>>>> alternative suggested by Joseph. I am open-minded which approach will
>>>> be chosen. I just want to fix this long pending issue.
>>>> I split up this patch in two parts. The first simply extends the
>>>> struct attribute_spec by new member 'on_diagnostic' and extends the
>>>> the uses of this structure by this new field. This new member
>>>> specifies if the attribute shall be show on diagnostic output, or not.
>>>
>>> This seems like a reasonable approach, but I'd prefer to describe/name
>>> the
>>> field as indicating that the attribute affects type compatibility (since
>>> that's why we want to see the attribute in diagnostics), and making the
>>> default comp_type_attributes use that information.
>
>

I thought to use here instead of on_diagnostic (which is IMHO fine too
as it indicates for now only that attribute shall be displayed on
diagnostics) "affects_abi". I think it makes sense to keep that name
as short as possible.

Regards,
Kai

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-03-17 16:08               ` Kai Tietz
@ 2011-03-17 16:17                 ` Jason Merrill
  2011-03-17 16:24                   ` Kai Tietz
  0 siblings, 1 reply; 19+ messages in thread
From: Jason Merrill @ 2011-03-17 16:17 UTC (permalink / raw)
  To: Kai Tietz
  Cc: Gabriel Dos Reis, Joseph S. Myers, GCC Patches, Richard Henderson

On 03/17/2011 12:08 PM, Kai Tietz wrote:
> I thought to use here instead of on_diagnostic (which is IMHO fine too
> as it indicates for now only that attribute shall be displayed on
> diagnostics) "affects_abi". I think it makes sense to keep that name
> as short as possible.

Hmm, type compatibility is higher level than the ABI; it affects whether 
two declarations are considered to be the same.  I think clarity is more 
important than a short name for something that shouldn't be used in that 
many places.  I'd prefer "affects_type_identity".

And does changing comp_type_attributes to check it make sense to you?

Jason

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-03-17 16:17                 ` Jason Merrill
@ 2011-03-17 16:24                   ` Kai Tietz
  2011-03-17 17:03                     ` Kai Tietz
  0 siblings, 1 reply; 19+ messages in thread
From: Kai Tietz @ 2011-03-17 16:24 UTC (permalink / raw)
  To: Jason Merrill
  Cc: Gabriel Dos Reis, Joseph S. Myers, GCC Patches, Richard Henderson

2011/3/17 Jason Merrill <jason@redhat.com>:
> On 03/17/2011 12:08 PM, Kai Tietz wrote:
>>
>> I thought to use here instead of on_diagnostic (which is IMHO fine too
>> as it indicates for now only that attribute shall be displayed on
>> diagnostics) "affects_abi". I think it makes sense to keep that name
>> as short as possible.
>
> Hmm, type compatibility is higher level than the ABI; it affects whether two
> declarations are considered to be the same.  I think clarity is more
> important than a short name for something that shouldn't be used in that
> many places.  I'd prefer "affects_type_identity".

I will update the patch and using this name

> And does changing comp_type_attributes to check it make sense to you?

Well, in general it would, but not all of those affecting type
identity in 64-bit vs. 32-bit case. Most of them affect type identity
only in 32-bit, but not for 64-bit )at least so for amd64/x86). So I
don't think we will profit here much.


Kai

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-03-17 16:24                   ` Kai Tietz
@ 2011-03-17 17:03                     ` Kai Tietz
  2011-03-18 21:42                       ` Jason Merrill
  0 siblings, 1 reply; 19+ messages in thread
From: Kai Tietz @ 2011-03-17 17:03 UTC (permalink / raw)
  To: Jason Merrill
  Cc: Gabriel Dos Reis, Joseph S. Myers, GCC Patches, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 4201 bytes --]

2011/3/17 Kai Tietz <ktietz70@googlemail.com>:
> 2011/3/17 Jason Merrill <jason@redhat.com>:
>> On 03/17/2011 12:08 PM, Kai Tietz wrote:
>>>
>>> I thought to use here instead of on_diagnostic (which is IMHO fine too
>>> as it indicates for now only that attribute shall be displayed on
>>> diagnostics) "affects_abi". I think it makes sense to keep that name
>>> as short as possible.
>>
>> Hmm, type compatibility is higher level than the ABI; it affects whether two
>> declarations are considered to be the same.  I think clarity is more
>> important than a short name for something that shouldn't be used in that
>> many places.  I'd prefer "affects_type_identity".
>
> I will update the patch and using this name
>
>> And does changing comp_type_attributes to check it make sense to you?
>
> Well, in general it would, but not all of those affecting type
> identity in 64-bit vs. 32-bit case. Most of them affect type identity
> only in 32-bit, but not for 64-bit )at least so for amd64/x86). So I
> don't think we will profit here much.

So updated patch

ChangeLog gcc/

2011-03-17  Kai Tietz

       PR target/12171
       * doc/plugins.texi: Adjust documentation
       for plugin register_callback.
       * tree.h (attribute_spec): Add new member
       affects_type_identity.
       * attribs.c (empty_attribute_table): Adjust
       attribute_spec initializers.
       * config/alpha/alpha.c: Likewise.
       * config/arc/arc.c: Likewise.
       * config/arm/arm.c: Likewise.
       * config/avr/avr.c: Likewise.
       * config/bfin/bfin.c: Likewise.
       * config/crx/crx.c: Likewise.
       * config/darwin.h: Likewise.
       * config/h8300/h8300.c: Likewise.
       * config/i386/cygming.h: Likewise.
       * config/i386/i386.c: Likewise.
       * config/ia64/ia64.c: Likewise.
       * config/m32c/m32c.c: Likewise.
       * config/m32r/m32r.c: Likewise.
       * config/m68hc11/m68hc11.c: Likewise.
       * config/m68k/m68k.c: Likewise.
       * config/mcore/mcore.c: Likewise.
       * config/mep/mep.c: Likewise.
       * config/microblaze/microblaze.c: Likewise.
       * config/mips/mips.c: Likewise.
       * config/rs6000/rs6000.c: Likewise.
       * config/rx/rx.c: Likewise.
       * config/sh/sh.c: Likewise.
       * config/sol2.h: Likewise.
       * config/sparc/sparc.c: Likewise.
       * config/spu/spu.c: Likewise.
       * config/stormy16/stormy16.c: Likewise.
       * config/v850/v850.c: Likewise.

ChangeLog gcc/cp

2011-03-17  Kai Tietz

       PR target/12171
       * tree.c (cxx_attribute_table): Adjust table.

ChangeLog gcc/testsuite

2011-03-17  Kai Tietz

       PR target/12171
       * g++.dg/plugin/attribute_plugin.c: Adjust test.

ChangeLog gcc/java

2011-03-17  Kai Tietz

       PR target/12171
       * lang.c (java_attribute_table): Adjust table.

ChangeLog gcc/lto

2011-03-17  Kai Tietz

       PR target/12171
       * lto-lang.c (lto_attribute_table): Adjust table.

ChangeLog gcc/ada

2011-03-17  Kai Tietz

       PR target/12171
       * gcc-interface/utils.c (gnat_internal_attribute_table):
       Add new element.

ChangeLog gcc/c-family

2011-03-17  Kai Tietz

       PR target/12171
       * c-common.c (c_common_attribute_table):
       Add new element.
       (c_common_format_attribute_table): Likewise.

The second part is the patch for c and c++ frontend parts to use new
diagnostic option for displaying of function pointer types.

ChangeLog gcc/c-family

2011-03-17  Kai Tietz

       PR target/12171
       * c-pretty-print.c (pp_c_specifier_qualifier_list):
       Display allowed attributes for function pointer types.
       (pp_c_attributes_display): New function to display
       attributes having affects_type_identity flag set to true.
       * c-pretty-print.h (pp_c_attributes_display): New prototype.

ChangeLog gcc/cp

2011-03-17  Kai Tietz

       PR target/12171
       * cxx-pretty-print.c (pp_cxx_ptr_operator):
       Display allowed attributes for function pointer types.
       * error.c (dump_type_

Hope I didn't missed a target here in first patch.

Regards,
Kai

[-- Attachment #2: dispattr.txt --]
[-- Type: text/plain, Size: 63303 bytes --]

Index: gcc/gcc/ada/gcc-interface/utils.c
===================================================================
--- gcc.orig/gcc/ada/gcc-interface/utils.c	2011-02-03 21:36:52.026798400 +0100
+++ gcc/gcc/ada/gcc-interface/utils.c	2011-03-17 17:53:01.101868900 +0100
@@ -104,29 +104,42 @@ static tree fake_attribute_handler
    this minimal set of attributes to accommodate the needs of builtins.  */
 const struct attribute_spec gnat_internal_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "const",        0, 0,  true,  false, false, handle_const_attribute   },
-  { "nothrow",      0, 0,  true,  false, false, handle_nothrow_attribute },
-  { "pure",         0, 0,  true,  false, false, handle_pure_attribute },
-  { "no vops",      0, 0,  true,  false, false, handle_novops_attribute },
-  { "nonnull",      0, -1, false, true,  true,  handle_nonnull_attribute },
-  { "sentinel",     0, 1,  false, true,  true,  handle_sentinel_attribute },
-  { "noreturn",     0, 0,  true,  false, false, handle_noreturn_attribute },
-  { "leaf",         0, 0,  true,  false, false, handle_leaf_attribute },
-  { "malloc",       0, 0,  true,  false, false, handle_malloc_attribute },
-  { "type generic", 0, 0,  false, true, true, handle_type_generic_attribute },
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "const",        0, 0,  true,  false, false, handle_const_attribute,
+    false },
+  { "nothrow",      0, 0,  true,  false, false, handle_nothrow_attribute,
+    false },
+  { "pure",         0, 0,  true,  false, false, handle_pure_attribute,
+    false },
+  { "no vops",      0, 0,  true,  false, false, handle_novops_attribute,
+    false },
+  { "nonnull",      0, -1, false, true,  true,  handle_nonnull_attribute,
+    false },
+  { "sentinel",     0, 1,  false, true,  true,  handle_sentinel_attribute,
+    false },
+  { "noreturn",     0, 0,  true,  false, false, handle_noreturn_attribute,
+    false },
+  { "leaf",         0, 0,  true,  false, false, handle_leaf_attribute,
+    false },
+  { "malloc",       0, 0,  true,  false, false, handle_malloc_attribute,
+    false },
+  { "type generic", 0, 0,  false, true, true, handle_type_generic_attribute,
+    false },
 
-  { "vector_size",  1, 1,  false, true, false,  handle_vector_size_attribute },
-  { "vector_type",  0, 0,  false, true, false,  handle_vector_type_attribute },
-  { "may_alias",    0, 0, false, true, false, NULL },
+  { "vector_size",  1, 1,  false, true, false,  handle_vector_size_attribute,
+    false },
+  { "vector_type",  0, 0,  false, true, false,  handle_vector_type_attribute,
+    false },
+  { "may_alias",    0, 0, false, true, false, NULL, false },
 
   /* ??? format and format_arg are heavy and not supported, which actually
      prevents support for stdio builtins, which we however declare as part
      of the common builtins.def contents.  */
-  { "format",     3, 3,  false, true,  true,  fake_attribute_handler },
-  { "format_arg", 1, 1,  false, true,  true,  fake_attribute_handler },
+  { "format",     3, 3,  false, true,  true,  fake_attribute_handler, false },
+  { "format_arg", 1, 1,  false, true,  true,  fake_attribute_handler, false },
 
-  { NULL,         0, 0, false, false, false, NULL }
+  { NULL,         0, 0, false, false, false, NULL, false }
 };
 
 /* Associates a GNAT tree node to a GCC tree node. It is used in
Index: gcc/gcc/attribs.c
===================================================================
--- gcc.orig/gcc/attribs.c	2011-03-12 17:04:44.483429200 +0100
+++ gcc/gcc/attribs.c	2011-03-17 17:53:01.154375600 +0100
@@ -57,7 +57,7 @@ static bool attributes_initialized = fal
 
 static const struct attribute_spec empty_attribute_table[] =
 {
-  { NULL, 0, 0, false, false, false, NULL }
+  { NULL, 0, 0, false, false, false, NULL, false }
 };
 
 /* Return base name of the attribute.  Ie '__attr__' is turned into 'attr'.
Index: gcc/gcc/c-family/c-common.c
===================================================================
--- gcc.orig/gcc/c-family/c-common.c	2011-03-16 16:24:17.935751400 +0100
+++ gcc/gcc/c-family/c-common.c	2011-03-17 17:53:01.190880200 +0100
@@ -588,123 +588,125 @@ const unsigned int num_c_common_reswords
 /* Table of machine-independent attributes common to all C-like languages.  */
 const struct attribute_spec c_common_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
   { "packed",                 0, 0, false, false, false,
-			      handle_packed_attribute },
+			      handle_packed_attribute , false},
   { "nocommon",               0, 0, true,  false, false,
-			      handle_nocommon_attribute },
+			      handle_nocommon_attribute, false},
   { "common",                 0, 0, true,  false, false,
-			      handle_common_attribute },
+			      handle_common_attribute, false },
   /* FIXME: logically, noreturn attributes should be listed as
      "false, true, true" and apply to function types.  But implementing this
      would require all the places in the compiler that use TREE_THIS_VOLATILE
      on a decl to identify non-returning functions to be located and fixed
      to check the function type instead.  */
   { "noreturn",               0, 0, true,  false, false,
-			      handle_noreturn_attribute },
+			      handle_noreturn_attribute, false },
   { "volatile",               0, 0, true,  false, false,
-			      handle_noreturn_attribute },
+			      handle_noreturn_attribute, false },
   { "noinline",               0, 0, true,  false, false,
-			      handle_noinline_attribute },
+			      handle_noinline_attribute, false },
   { "noclone",                0, 0, true,  false, false,
-			      handle_noclone_attribute },
+			      handle_noclone_attribute, false },
   { "leaf",                   0, 0, true,  false, false,
-			      handle_leaf_attribute },
+			      handle_leaf_attribute, false },
   { "always_inline",          0, 0, true,  false, false,
-			      handle_always_inline_attribute },
+			      handle_always_inline_attribute, false },
   { "gnu_inline",             0, 0, true,  false, false,
-			      handle_gnu_inline_attribute },
+			      handle_gnu_inline_attribute, false },
   { "artificial",             0, 0, true,  false, false,
-			      handle_artificial_attribute },
+			      handle_artificial_attribute, false },
   { "flatten",                0, 0, true,  false, false,
-			      handle_flatten_attribute },
+			      handle_flatten_attribute, false },
   { "used",                   0, 0, true,  false, false,
-			      handle_used_attribute },
+			      handle_used_attribute, false },
   { "unused",                 0, 0, false, false, false,
-			      handle_unused_attribute },
+			      handle_unused_attribute, false },
   { "externally_visible",     0, 0, true,  false, false,
-			      handle_externally_visible_attribute },
+			      handle_externally_visible_attribute, false },
   /* The same comments as for noreturn attributes apply to const ones.  */
   { "const",                  0, 0, true,  false, false,
-			      handle_const_attribute },
+			      handle_const_attribute, false },
   { "transparent_union",      0, 0, false, false, false,
-			      handle_transparent_union_attribute },
+			      handle_transparent_union_attribute, false },
   { "constructor",            0, 1, true,  false, false,
-			      handle_constructor_attribute },
+			      handle_constructor_attribute, false },
   { "destructor",             0, 1, true,  false, false,
-			      handle_destructor_attribute },
+			      handle_destructor_attribute, false },
   { "mode",                   1, 1, false,  true, false,
-			      handle_mode_attribute },
+			      handle_mode_attribute, false },
   { "section",                1, 1, true,  false, false,
-			      handle_section_attribute },
+			      handle_section_attribute, false },
   { "aligned",                0, 1, false, false, false,
-			      handle_aligned_attribute },
+			      handle_aligned_attribute, false },
   { "weak",                   0, 0, true,  false, false,
-			      handle_weak_attribute },
+			      handle_weak_attribute, false },
   { "ifunc",                  1, 1, true,  false, false,
-			      handle_ifunc_attribute },
+			      handle_ifunc_attribute, false },
   { "alias",                  1, 1, true,  false, false,
-			      handle_alias_attribute },
+			      handle_alias_attribute, false },
   { "weakref",                0, 1, true,  false, false,
-			      handle_weakref_attribute },
+			      handle_weakref_attribute, false },
   { "no_instrument_function", 0, 0, true,  false, false,
-			      handle_no_instrument_function_attribute },
+			      handle_no_instrument_function_attribute,
+			      false },
   { "malloc",                 0, 0, true,  false, false,
-			      handle_malloc_attribute },
+			      handle_malloc_attribute, false },
   { "returns_twice",          0, 0, true,  false, false,
-			      handle_returns_twice_attribute },
+			      handle_returns_twice_attribute, false },
   { "no_stack_limit",         0, 0, true,  false, false,
-			      handle_no_limit_stack_attribute },
+			      handle_no_limit_stack_attribute, false },
   { "pure",                   0, 0, true,  false, false,
-			      handle_pure_attribute },
+			      handle_pure_attribute, false },
   /* For internal use (marking of builtins) only.  The name contains space
      to prevent its usage in source code.  */
   { "no vops",                0, 0, true,  false, false,
-			      handle_novops_attribute },
+			      handle_novops_attribute, false },
   { "deprecated",             0, 1, false, false, false,
-			      handle_deprecated_attribute },
+			      handle_deprecated_attribute, false },
   { "vector_size",	      1, 1, false, true, false,
-			      handle_vector_size_attribute },
+			      handle_vector_size_attribute, false },
   { "visibility",	      1, 1, false, false, false,
-			      handle_visibility_attribute },
+			      handle_visibility_attribute, false },
   { "tls_model",	      1, 1, true,  false, false,
-			      handle_tls_model_attribute },
+			      handle_tls_model_attribute, false },
   { "nonnull",                0, -1, false, true, true,
-			      handle_nonnull_attribute },
+			      handle_nonnull_attribute, false },
   { "nothrow",                0, 0, true,  false, false,
-			      handle_nothrow_attribute },
-  { "may_alias",	      0, 0, false, true, false, NULL },
+			      handle_nothrow_attribute, false },
+  { "may_alias",	      0, 0, false, true, false, NULL, false },
   { "cleanup",		      1, 1, true, false, false,
-			      handle_cleanup_attribute },
+			      handle_cleanup_attribute, false },
   { "warn_unused_result",     0, 0, false, true, true,
-			      handle_warn_unused_result_attribute },
+			      handle_warn_unused_result_attribute, false },
   { "sentinel",               0, 1, false, true, true,
-			      handle_sentinel_attribute },
+			      handle_sentinel_attribute, false },
   /* For internal use (marking of builtins) only.  The name contains space
      to prevent its usage in source code.  */
   { "type generic",           0, 0, false, true, true,
-			      handle_type_generic_attribute },
+			      handle_type_generic_attribute, false },
   { "alloc_size",	      1, 2, false, true, true,
-			      handle_alloc_size_attribute },
+			      handle_alloc_size_attribute, false },
   { "cold",                   0, 0, true,  false, false,
-			      handle_cold_attribute },
+			      handle_cold_attribute, false },
   { "hot",                    0, 0, true,  false, false,
-			      handle_hot_attribute },
+			      handle_hot_attribute, false },
   { "warning",		      1, 1, true,  false, false,
-			      handle_error_attribute },
+			      handle_error_attribute, false },
   { "error",		      1, 1, true,  false, false,
-			      handle_error_attribute },
+			      handle_error_attribute, false },
   { "target",                 1, -1, true, false, false,
-			      handle_target_attribute },
+			      handle_target_attribute, false },
   { "optimize",               1, -1, true, false, false,
-			      handle_optimize_attribute },
+			      handle_optimize_attribute, false },
   { "no_split_stack",	      0, 0, true,  false, false,
-			      handle_no_split_stack_attribute },
+			      handle_no_split_stack_attribute, false },
   /* For internal use (marking of builtins and runtime functions) only.
      The name contains space to prevent its usage in source code.  */
   { "fn spec",	 	      1, 1, false, true, true,
-			      handle_fnspec_attribute },
-  { NULL,                     0, 0, false, false, false, NULL }
+			      handle_fnspec_attribute, false },
+  { NULL,                     0, 0, false, false, false, NULL, false }
 };
 
 /* Give the specifications for the format attributes, used by C and all
@@ -712,12 +714,13 @@ const struct attribute_spec c_common_att
 
 const struct attribute_spec c_common_format_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
   { "format",                 3, 3, false, true,  true,
-			      handle_format_attribute },
+			      handle_format_attribute, false },
   { "format_arg",             1, 1, false, true,  true,
-			      handle_format_arg_attribute },
-  { NULL,                     0, 0, false, false, false, NULL }
+			      handle_format_arg_attribute, false },
+  { NULL,                     0, 0, false, false, false, NULL, false }
 };
 
 /* Return identifier for address space AS.  */
Index: gcc/gcc/config/alpha/alpha.c
===================================================================
--- gcc.orig/gcc/config/alpha/alpha.c	2011-01-02 10:22:43.491561000 +0100
+++ gcc/gcc/config/alpha/alpha.c	2011-03-17 17:53:01.261889200 +0100
@@ -7582,9 +7582,10 @@ common_object_handler (tree *node, tree
 
 static const struct attribute_spec vms_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { COMMON_OBJECT,   0, 1, true,  false, false, common_object_handler },
-  { NULL,            0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { COMMON_OBJECT,   0, 1, true,  false, false, common_object_handler, false },
+  { NULL,            0, 0, false, false, false, NULL, false }
 };
 
 void
Index: gcc/gcc/config/arc/arc.c
===================================================================
--- gcc.orig/gcc/config/arc/arc.c	2011-01-02 10:22:43.513561000 +0100
+++ gcc/gcc/config/arc/arc.c	2011-03-17 17:53:01.313395800 +0100
@@ -107,9 +107,11 @@ static void arc_conditional_register_usa
 
 static const struct attribute_spec arc_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt", 1, 1, true,  false, false, arc_handle_interrupt_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "interrupt", 1, 1, true,  false, false, arc_handle_interrupt_attribute,
+    false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 \f
 /* Initialize the GCC target structure.  */
Index: gcc/gcc/config/arm/arm.c
===================================================================
--- gcc.orig/gcc/config/arm/arm.c	2011-01-29 09:32:53.331875700 +0100
+++ gcc/gcc/config/arm/arm.c	2011-03-17 17:53:01.384904900 +0100
@@ -255,20 +255,25 @@ static reg_class_t arm_preferred_rename_
 /* Table of machine attributes.  */
 static const struct attribute_spec arm_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
   /* Function calls made to this symbol must be done indirectly, because
      it may lie outside of the 26 bit addressing range of a normal function
      call.  */
-  { "long_call",    0, 0, false, true,  true,  NULL },
+  { "long_call",    0, 0, false, true,  true,  NULL, false },
   /* Whereas these functions are always known to reside within the 26 bit
      addressing range.  */
-  { "short_call",   0, 0, false, true,  true,  NULL },
+  { "short_call",   0, 0, false, true,  true,  NULL, false },
   /* Specify the procedure call conventions for a function.  */
-  { "pcs",          1, 1, false, true,  true,  arm_handle_pcs_attribute },
+  { "pcs",          1, 1, false, true,  true,  arm_handle_pcs_attribute,
+    false },
   /* Interrupt Service Routines have special prologue and epilogue requirements.  */
-  { "isr",          0, 1, false, false, false, arm_handle_isr_attribute },
-  { "interrupt",    0, 1, false, false, false, arm_handle_isr_attribute },
-  { "naked",        0, 0, true,  false, false, arm_handle_fndecl_attribute },
+  { "isr",          0, 1, false, false, false, arm_handle_isr_attribute,
+    false },
+  { "interrupt",    0, 1, false, false, false, arm_handle_isr_attribute,
+    false },
+  { "naked",        0, 0, true,  false, false, arm_handle_fndecl_attribute,
+    false },
 #ifdef ARM_PE
   /* ARM/PE has three new attributes:
      interfacearm - ?
@@ -279,15 +284,17 @@ static const struct attribute_spec arm_a
      them with spaces.  We do NOT support this.  Instead, use __declspec
      multiple times.
   */
-  { "dllimport",    0, 0, true,  false, false, NULL },
-  { "dllexport",    0, 0, true,  false, false, NULL },
-  { "interfacearm", 0, 0, true,  false, false, arm_handle_fndecl_attribute },
+  { "dllimport",    0, 0, true,  false, false, NULL, false },
+  { "dllexport",    0, 0, true,  false, false, NULL, false },
+  { "interfacearm", 0, 0, true,  false, false, arm_handle_fndecl_attribute,
+    false },
 #elif TARGET_DLLIMPORT_DECL_ATTRIBUTES
-  { "dllimport",    0, 0, false, false, false, handle_dll_attribute },
-  { "dllexport",    0, 0, false, false, false, handle_dll_attribute },
-  { "notshared",    0, 0, false, true, false, arm_handle_notshared_attribute },
+  { "dllimport",    0, 0, false, false, false, handle_dll_attribute, false },
+  { "dllexport",    0, 0, false, false, false, handle_dll_attribute, false },
+  { "notshared",    0, 0, false, true, false, arm_handle_notshared_attribute,
+    false },
 #endif
-  { NULL,           0, 0, false, false, false, NULL }
+  { NULL,           0, 0, false, false, false, NULL, false }
 };
 
 /* Set default optimization options.  */
Index: gcc/gcc/config/avr/avr.c
===================================================================
--- gcc.orig/gcc/config/avr/avr.c	2011-03-12 17:04:42.382309000 +0100
+++ gcc/gcc/config/avr/avr.c	2011-03-17 17:53:01.464415000 +0100
@@ -127,14 +127,21 @@ section *progmem_section;
 /* AVR attributes.  */
 static const struct attribute_spec avr_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "progmem",   0, 0, false, false, false,  avr_handle_progmem_attribute },
-  { "signal",    0, 0, true,  false, false,  avr_handle_fndecl_attribute },
-  { "interrupt", 0, 0, true,  false, false,  avr_handle_fndecl_attribute },
-  { "naked",     0, 0, false, true,  true,   avr_handle_fntype_attribute },
-  { "OS_task",   0, 0, false, true,  true,   avr_handle_fntype_attribute },
-  { "OS_main",   0, 0, false, true,  true,   avr_handle_fntype_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "progmem",   0, 0, false, false, false,  avr_handle_progmem_attribute,
+    false },
+  { "signal",    0, 0, true,  false, false,  avr_handle_fndecl_attribute,
+    false },
+  { "interrupt", 0, 0, true,  false, false,  avr_handle_fndecl_attribute,
+    false },
+  { "naked",     0, 0, false, true,  true,   avr_handle_fntype_attribute,
+    false },
+  { "OS_task",   0, 0, false, true,  true,   avr_handle_fntype_attribute,
+    false },
+  { "OS_main",   0, 0, false, true,  true,   avr_handle_fntype_attribute,
+    false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
Index: gcc/gcc/config/bfin/bfin.c
===================================================================
--- gcc.orig/gcc/config/bfin/bfin.c	2011-01-02 10:22:43.852561000 +0100
+++ gcc/gcc/config/bfin/bfin.c	2011-03-17 17:53:01.519421900 +0100
@@ -5765,21 +5765,30 @@ bfin_handle_l2_attribute (tree *node, tr
 /* Table of valid machine attributes.  */
 static const struct attribute_spec bfin_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt_handler", 0, 0, false, true,  true, handle_int_attribute },
-  { "exception_handler", 0, 0, false, true,  true, handle_int_attribute },
-  { "nmi_handler", 0, 0, false, true,  true, handle_int_attribute },
-  { "nesting", 0, 0, false, true,  true, NULL },
-  { "kspisusp", 0, 0, false, true,  true, NULL },
-  { "saveall", 0, 0, false, true,  true, NULL },
-  { "longcall",  0, 0, false, true,  true,  bfin_handle_longcall_attribute },
-  { "shortcall", 0, 0, false, true,  true,  bfin_handle_longcall_attribute },
-  { "l1_text", 0, 0, true, false, false,  bfin_handle_l1_text_attribute },
-  { "l1_data", 0, 0, true, false, false,  bfin_handle_l1_data_attribute },
-  { "l1_data_A", 0, 0, true, false, false, bfin_handle_l1_data_attribute },
-  { "l1_data_B", 0, 0, true, false, false,  bfin_handle_l1_data_attribute },
-  { "l2", 0, 0, true, false, false,  bfin_handle_l2_attribute },
-  { NULL, 0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "interrupt_handler", 0, 0, false, true,  true, handle_int_attribute,
+    false },
+  { "exception_handler", 0, 0, false, true,  true, handle_int_attribute,
+    false },
+  { "nmi_handler", 0, 0, false, true,  true, handle_int_attribute, false },
+  { "nesting", 0, 0, false, true,  true, NULL, false },
+  { "kspisusp", 0, 0, false, true,  true, NULL, false },
+  { "saveall", 0, 0, false, true,  true, NULL, false },
+  { "longcall",  0, 0, false, true,  true,  bfin_handle_longcall_attribute,
+    false },
+  { "shortcall", 0, 0, false, true,  true,  bfin_handle_longcall_attribute,
+    false },
+  { "l1_text", 0, 0, true, false, false,  bfin_handle_l1_text_attribute,
+    false },
+  { "l1_data", 0, 0, true, false, false,  bfin_handle_l1_data_attribute,
+    false },
+  { "l1_data_A", 0, 0, true, false, false, bfin_handle_l1_data_attribute,
+    false },
+  { "l1_data_B", 0, 0, true, false, false,  bfin_handle_l1_data_attribute,
+    false },
+  { "l2", 0, 0, true, false, false,  bfin_handle_l2_attribute, false },
+  { NULL, 0, 0, false, false, false, NULL, false }
 };
 \f
 /* Implementation of TARGET_ASM_INTEGER.  When using FD-PIC, we need to
Index: gcc/gcc/config/crx/crx.c
===================================================================
--- gcc.orig/gcc/config/crx/crx.c	2011-01-02 10:22:43.860561000 +0100
+++ gcc/gcc/config/crx/crx.c	2011-03-17 17:53:01.564927700 +0100
@@ -183,8 +183,8 @@ static void crx_function_arg_advance (CU
 
 static const struct attribute_spec crx_attribute_table[] = {
   /* ISRs have special prologue and epilogue requirements. */
-  {"interrupt", 0, 0, false, true, true, NULL},
-  {NULL, 0, 0, false, false, false, NULL}
+  {"interrupt", 0, 0, false, true, true, NULL, false},
+  {NULL, 0, 0, false, false, false, NULL, false}
 };
 
 /* Option handling.  */
Index: gcc/gcc/config/darwin.h
===================================================================
--- gcc.orig/gcc/config/darwin.h	2011-02-18 18:34:10.966378700 +0100
+++ gcc/gcc/config/darwin.h	2011-03-17 17:53:01.590431000 +0100
@@ -726,11 +726,12 @@ extern GTY(()) section * darwin_sections
 
 /* Extra attributes for Darwin.  */
 #define SUBTARGET_ATTRIBUTE_TABLE					     \
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ \
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,     \
+       affects_type_identity } */						     \
   { "apple_kext_compatibility", 0, 0, false, true, false,		     \
-    darwin_handle_kext_attribute },					     \
+    darwin_handle_kext_attribute, false },				     \
   { "weak_import", 0, 0, true, false, false,				     \
-    darwin_handle_weak_import_attribute }
+    darwin_handle_weak_import_attribute, false }
 
 #undef ASM_GENERATE_INTERNAL_LABEL
 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)	\
Index: gcc/gcc/config/h8300/h8300.c
===================================================================
--- gcc.orig/gcc/config/h8300/h8300.c	2011-01-02 10:22:43.904561000 +0100
+++ gcc/gcc/config/h8300/h8300.c	2011-03-17 17:53:01.627935700 +0100
@@ -5367,15 +5367,23 @@ h8300_insert_attributes (tree node, tree
 
 static const struct attribute_spec h8300_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt_handler", 0, 0, true,  false, false, h8300_handle_fndecl_attribute },
-  { "saveall",           0, 0, true,  false, false, h8300_handle_fndecl_attribute },
-  { "OS_Task",           0, 0, true,  false, false, h8300_handle_fndecl_attribute },
-  { "monitor",           0, 0, true,  false, false, h8300_handle_fndecl_attribute },
-  { "function_vector",   0, 0, true,  false, false, h8300_handle_fndecl_attribute },
-  { "eightbit_data",     0, 0, true,  false, false, h8300_handle_eightbit_data_attribute },
-  { "tiny_data",         0, 0, true,  false, false, h8300_handle_tiny_data_attribute },
-  { NULL,                0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "interrupt_handler", 0, 0, true,  false, false,
+    h8300_handle_fndecl_attribute, false },
+  { "saveall",           0, 0, true,  false, false,
+    h8300_handle_fndecl_attribute, false },
+  { "OS_Task",           0, 0, true,  false, false,
+    h8300_handle_fndecl_attribute, false },
+  { "monitor",           0, 0, true,  false, false,
+    h8300_handle_fndecl_attribute, false },
+  { "function_vector",   0, 0, true,  false, false,
+    h8300_handle_fndecl_attribute, false },
+  { "eightbit_data",     0, 0, true,  false, false,
+    h8300_handle_eightbit_data_attribute, false },
+  { "tiny_data",         0, 0, true,  false, false,
+    h8300_handle_tiny_data_attribute, false },
+  { NULL,                0, 0, false, false, false, NULL, false }
 };
 
 
Index: gcc/gcc/config/i386/cygming.h
===================================================================
--- gcc.orig/gcc/config/i386/cygming.h	2011-01-13 20:55:30.346568300 +0100
+++ gcc/gcc/config/i386/cygming.h	2011-03-17 17:53:01.661940000 +0100
@@ -454,8 +454,10 @@ do {						\
 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL))
 
 #define SUBTARGET_ATTRIBUTE_TABLE \
-  { "selectany", 0, 0, true, false, false, ix86_handle_selectany_attribute }
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  { "selectany", 0, 0, true, false, false, ix86_handle_selectany_attribute, \
+    false }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
 
 /*  mcount() does not need a counter variable.  */
 #undef NO_PROFILE_COUNTERS
Index: gcc/gcc/config/i386/i386.c
===================================================================
--- gcc.orig/gcc/config/i386/i386.c	2011-03-17 10:33:01.211508600 +0100
+++ gcc/gcc/config/i386/i386.c	2011-03-17 17:53:01.703445300 +0100
@@ -32728,45 +32728,56 @@ ix86_expand_round (rtx operand0, rtx ope
 /* Table of valid machine attributes.  */
 static const struct attribute_spec ix86_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
   /* Stdcall attribute says callee is responsible for popping arguments
      if they are not variable.  */
-  { "stdcall",   0, 0, false, true,  true,  ix86_handle_cconv_attribute },
+  { "stdcall",   0, 0, false, true,  true,  ix86_handle_cconv_attribute,
+    true },
   /* Fastcall attribute says callee is responsible for popping arguments
      if they are not variable.  */
-  { "fastcall",  0, 0, false, true,  true,  ix86_handle_cconv_attribute },
+  { "fastcall",  0, 0, false, true,  true,  ix86_handle_cconv_attribute,
+    true },
   /* Thiscall attribute says callee is responsible for popping arguments
      if they are not variable.  */
-  { "thiscall",  0, 0, false, true,  true,  ix86_handle_cconv_attribute },
+  { "thiscall",  0, 0, false, true,  true,  ix86_handle_cconv_attribute,
+    true },
   /* Cdecl attribute says the callee is a normal C declaration */
-  { "cdecl",     0, 0, false, true,  true,  ix86_handle_cconv_attribute },
+  { "cdecl",     0, 0, false, true,  true,  ix86_handle_cconv_attribute,
+    true },
   /* Regparm attribute specifies how many integer arguments are to be
      passed in registers.  */
-  { "regparm",   1, 1, false, true,  true,  ix86_handle_cconv_attribute },
+  { "regparm",   1, 1, false, true,  true,  ix86_handle_cconv_attribute,
+    true },
   /* Sseregparm attribute says we are using x86_64 calling conventions
      for FP arguments.  */
-  { "sseregparm", 0, 0, false, true, true, ix86_handle_cconv_attribute },
+  { "sseregparm", 0, 0, false, true, true, ix86_handle_cconv_attribute,
+    true },
   /* force_align_arg_pointer says this function realigns the stack at entry.  */
   { (const char *)&ix86_force_align_arg_pointer_string, 0, 0,
-    false, true,  true, ix86_handle_cconv_attribute },
+    false, true,  true, ix86_handle_cconv_attribute, false },
 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
-  { "dllimport", 0, 0, false, false, false, handle_dll_attribute },
-  { "dllexport", 0, 0, false, false, false, handle_dll_attribute },
-  { "shared",    0, 0, true,  false, false, ix86_handle_shared_attribute },
+  { "dllimport", 0, 0, false, false, false, handle_dll_attribute, false },
+  { "dllexport", 0, 0, false, false, false, handle_dll_attribute, false },
+  { "shared",    0, 0, true,  false, false, ix86_handle_shared_attribute,
+    false },
 #endif
-  { "ms_struct", 0, 0, false, false,  false, ix86_handle_struct_attribute },
-  { "gcc_struct", 0, 0, false, false,  false, ix86_handle_struct_attribute },
+  { "ms_struct", 0, 0, false, false,  false, ix86_handle_struct_attribute,
+    false },
+  { "gcc_struct", 0, 0, false, false,  false, ix86_handle_struct_attribute,
+    false },
 #ifdef SUBTARGET_ATTRIBUTE_TABLE
   SUBTARGET_ATTRIBUTE_TABLE,
 #endif
   /* ms_abi and sysv_abi calling convention function attributes.  */
-  { "ms_abi", 0, 0, false, true, true, ix86_handle_abi_attribute },
-  { "sysv_abi", 0, 0, false, true, true, ix86_handle_abi_attribute },
-  { "ms_hook_prologue", 0, 0, true, false, false, ix86_handle_fndecl_attribute },
+  { "ms_abi", 0, 0, false, true, true, ix86_handle_abi_attribute, true },
+  { "sysv_abi", 0, 0, false, true, true, ix86_handle_abi_attribute, true },
+  { "ms_hook_prologue", 0, 0, true, false, false, ix86_handle_fndecl_attribute,
+    false },
   { "callee_pop_aggregate_return", 1, 1, false, true, true,
-    ix86_handle_callee_pop_aggregate_return },
+    ix86_handle_callee_pop_aggregate_return, true },
   /* End element.  */
-  { NULL,        0, 0, false, false, false, NULL }
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 /* Implement targetm.vectorize.builtin_vectorization_cost.  */
Index: gcc/gcc/config/ia64/ia64.c
===================================================================
--- gcc.orig/gcc/config/ia64/ia64.c	2011-02-05 10:56:51.231225100 +0100
+++ gcc/gcc/config/ia64/ia64.c	2011-03-17 17:53:01.782955400 +0100
@@ -342,15 +342,18 @@ static section * ia64_hpux_function_sect
 /* Table of valid machine attributes.  */
 static const struct attribute_spec ia64_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "syscall_linkage", 0, 0, false, true,  true,  NULL },
-  { "model",	       1, 1, true, false, false, ia64_handle_model_attribute },
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "syscall_linkage", 0, 0, false, true,  true,  NULL, false },
+  { "model",	       1, 1, true, false, false, ia64_handle_model_attribute,
+    false },
 #if TARGET_ABI_OPEN_VMS
-  { "common_object",   1, 1, true, false, false, ia64_vms_common_object_attribute},
+  { "common_object",   1, 1, true, false, false,
+    ia64_vms_common_object_attribute, false },
 #endif
   { "version_id",      1, 1, true, false, false,
-    ia64_handle_version_id_attribute },
-  { NULL,	       0, 0, false, false, false, NULL }
+    ia64_handle_version_id_attribute, false },
+  { NULL,	       0, 0, false, false, false, NULL, false }
 };
 
 /* Implement overriding of the optimization options.  */
Index: gcc/gcc/config/m32c/m32c.c
===================================================================
--- gcc.orig/gcc/config/m32c/m32c.c	2011-02-10 21:30:42.703209100 +0100
+++ gcc/gcc/config/m32c/m32c.c	2011-03-17 17:53:01.845963400 +0100
@@ -3232,11 +3232,12 @@ current_function_special_page_vector (rt
 #undef TARGET_ATTRIBUTE_TABLE
 #define TARGET_ATTRIBUTE_TABLE m32c_attribute_table
 static const struct attribute_spec m32c_attribute_table[] = {
-  {"interrupt", 0, 0, false, false, false, interrupt_handler},
-  {"bank_switch", 0, 0, false, false, false, interrupt_handler},
-  {"fast_interrupt", 0, 0, false, false, false, interrupt_handler},
-  {"function_vector", 1, 1, true,  false, false, function_vector_handler},
-  {0, 0, 0, 0, 0, 0, 0}
+  {"interrupt", 0, 0, false, false, false, interrupt_handler, false},
+  {"bank_switch", 0, 0, false, false, false, interrupt_handler, false},
+  {"fast_interrupt", 0, 0, false, false, false, interrupt_handler, false},
+  {"function_vector", 1, 1, true,  false, false, function_vector_handler,
+   false},
+  {0, 0, 0, 0, 0, 0, 0, false}
 };
 
 #undef TARGET_COMP_TYPE_ATTRIBUTES
Index: gcc/gcc/config/m32r/m32r.c
===================================================================
--- gcc.orig/gcc/config/m32r/m32r.c	2011-02-18 20:26:53.770188900 +0100
+++ gcc/gcc/config/m32r/m32r.c	2011-03-17 17:53:01.891969300 +0100
@@ -108,10 +108,12 @@ static void m32r_trampoline_init (rtx, t
 
 static const struct attribute_spec m32r_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt", 0, 0, true,  false, false, NULL },
-  { "model",     1, 1, true,  false, false, m32r_handle_model_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "interrupt", 0, 0, true,  false, false, NULL, false },
+  { "model",     1, 1, true,  false, false, m32r_handle_model_attribute,
+    false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 static const struct default_options m32r_option_optimization_table[] =
Index: gcc/gcc/config/m68hc11/m68hc11.c
===================================================================
--- gcc.orig/gcc/config/m68hc11/m68hc11.c	2011-01-02 10:22:44.173561000 +0100
+++ gcc/gcc/config/m68hc11/m68hc11.c	2011-03-17 17:53:01.933974600 +0100
@@ -231,13 +231,19 @@ static const struct processor_costs m681
 
 static const struct attribute_spec m68hc11_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt", 0, 0, false, true,  true,  m68hc11_handle_fntype_attribute },
-  { "trap",      0, 0, false, true,  true,  m68hc11_handle_fntype_attribute },
-  { "far",       0, 0, false, true,  true,  m68hc11_handle_fntype_attribute },
-  { "near",      0, 0, false, true,  true,  m68hc11_handle_fntype_attribute },
-  { "page0",     0, 0, false, false, false, m68hc11_handle_page0_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "interrupt", 0, 0, false, true,  true,  m68hc11_handle_fntype_attribute,
+    false },
+  { "trap",      0, 0, false, true,  true,  m68hc11_handle_fntype_attribute,
+    false },
+  { "far",       0, 0, false, true,  true,  m68hc11_handle_fntype_attribute,
+    false },
+  { "near",      0, 0, false, true,  true,  m68hc11_handle_fntype_attribute,
+    false },
+  { "page0",     0, 0, false, false, false, m68hc11_handle_page0_attribute,
+    false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 \f
 /* Initialize the GCC target structure.  */
Index: gcc/gcc/config/m68k/m68k.c
===================================================================
--- gcc.orig/gcc/config/m68k/m68k.c	2011-01-02 10:22:44.193561000 +0100
+++ gcc/gcc/config/m68k/m68k.c	2011-03-17 17:53:01.985981200 +0100
@@ -298,11 +298,15 @@ const char *m68k_library_id_string = "_c
 
 static const struct attribute_spec m68k_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt", 0, 0, true,  false, false, m68k_handle_fndecl_attribute },
-  { "interrupt_handler", 0, 0, true,  false, false, m68k_handle_fndecl_attribute },
-  { "interrupt_thread", 0, 0, true,  false, false, m68k_handle_fndecl_attribute },
-  { NULL,                0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "interrupt", 0, 0, true,  false, false, m68k_handle_fndecl_attribute,
+    false },
+  { "interrupt_handler", 0, 0, true,  false, false,
+    m68k_handle_fndecl_attribute, false },
+  { "interrupt_thread", 0, 0, true,  false, false,
+    m68k_handle_fndecl_attribute, false },
+  { NULL,                0, 0, false, false, false, NULL, false }
 };
 
 struct gcc_target targetm = TARGET_INITIALIZER;
Index: gcc/gcc/config/mcore/mcore.c
===================================================================
--- gcc.orig/gcc/config/mcore/mcore.c	2011-02-14 19:30:44.593188100 +0100
+++ gcc/gcc/config/mcore/mcore.c	2011-03-17 17:53:02.029986800 +0100
@@ -143,11 +143,13 @@ static void       mcore_option_override
 
 static const struct attribute_spec mcore_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "dllexport", 0, 0, true,  false, false, NULL },
-  { "dllimport", 0, 0, true,  false, false, NULL },
-  { "naked",     0, 0, true,  false, false, mcore_handle_naked_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "dllexport", 0, 0, true,  false, false, NULL, false },
+  { "dllimport", 0, 0, true,  false, false, NULL, false },
+  { "naked",     0, 0, true,  false, false, mcore_handle_naked_attribute,
+    false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 /* What options are we going to default to specific settings when
Index: gcc/gcc/config/mep/mep.c
===================================================================
--- gcc.orig/gcc/config/mep/mep.c	2011-01-02 10:22:44.243561000 +0100
+++ gcc/gcc/config/mep/mep.c	2011-03-17 17:53:02.075992600 +0100
@@ -4088,17 +4088,19 @@ mep_validate_vliw (tree *node, tree name
 
 static const struct attribute_spec mep_attribute_table[11] =
 {
-  /* name         min max decl   type   func   handler */
-  { "based",        0, 0, false, false, false, mep_validate_based_tiny },
-  { "tiny",         0, 0, false, false, false, mep_validate_based_tiny },
-  { "near",         0, 0, false, false, false, mep_validate_near_far },
-  { "far",          0, 0, false, false, false, mep_validate_near_far },
-  { "disinterrupt", 0, 0, false, false, false, mep_validate_disinterrupt },
-  { "interrupt",    0, 0, false, false, false, mep_validate_interrupt },
-  { "io",           0, 1, false, false, false, mep_validate_io_cb },
-  { "cb",           0, 1, false, false, false, mep_validate_io_cb },
-  { "vliw",         0, 0, false, true,  false, mep_validate_vliw },
-  { NULL,           0, 0, false, false, false, NULL }
+  /* name         min max decl   type   func   handler
+     affects_type_identity */
+  { "based",        0, 0, false, false, false, mep_validate_based_tiny, false },
+  { "tiny",         0, 0, false, false, false, mep_validate_based_tiny, false },
+  { "near",         0, 0, false, false, false, mep_validate_near_far, false },
+  { "far",          0, 0, false, false, false, mep_validate_near_far, false },
+  { "disinterrupt", 0, 0, false, false, false, mep_validate_disinterrupt,
+    false },
+  { "interrupt",    0, 0, false, false, false, mep_validate_interrupt, false },
+  { "io",           0, 1, false, false, false, mep_validate_io_cb, false },
+  { "cb",           0, 1, false, false, false, mep_validate_io_cb, false },
+  { "vliw",         0, 0, false, true,  false, mep_validate_vliw, false },
+  { NULL,           0, 0, false, false, false, NULL, false }
 };
 
 static bool
Index: gcc/gcc/config/microblaze/microblaze.c
===================================================================
--- gcc.orig/gcc/config/microblaze/microblaze.c	2011-01-02 10:22:44.270561000 +0100
+++ gcc/gcc/config/microblaze/microblaze.c	2011-03-17 17:53:02.122998600 +0100
@@ -195,10 +195,14 @@ int interrupt_handler;
 int save_volatiles;
 
 const struct attribute_spec microblaze_attribute_table[] = {
-  /* name         min_len, max_len, decl_req, type_req, fn_type, req_handler */
-  {"interrupt_handler", 0,       0,     true,    false,   false,        NULL},
-  {"save_volatiles"   , 0,       0,     true,    false,   false,        NULL},
-  { NULL,        	0,       0,    false,    false,   false,        NULL}
+  /* name         min_len, max_len, decl_req, type_req, fn_type, req_handler,
+     affects_type_identity */
+  {"interrupt_handler", 0,       0,     true,    false,   false,        NULL,
+    false },
+  {"save_volatiles"   , 0,       0,     true,    false,   false,        NULL,
+    false },
+  { NULL,        	0,       0,    false,    false,   false,        NULL,
+    false }
 };
 
 static int microblaze_interrupt_function_p (tree);
Index: gcc/gcc/config/mips/mips.c
===================================================================
--- gcc.orig/gcc/config/mips/mips.c	2011-03-12 17:04:44.401424500 +0100
+++ gcc/gcc/config/mips/mips.c	2011-03-17 17:53:02.182006100 +0100
@@ -641,22 +641,23 @@ const enum reg_class mips_regno_to_class
 
 /* The value of TARGET_ATTRIBUTE_TABLE.  */
 static const struct attribute_spec mips_attribute_table[] = {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "long_call",   0, 0, false, true,  true,  NULL },
-  { "far",     	   0, 0, false, true,  true,  NULL },
-  { "near",        0, 0, false, true,  true,  NULL },
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       om_diagnostic } */
+  { "long_call",   0, 0, false, true,  true,  NULL, false },
+  { "far",     	   0, 0, false, true,  true,  NULL, false },
+  { "near",        0, 0, false, true,  true,  NULL, false },
   /* We would really like to treat "mips16" and "nomips16" as type
      attributes, but GCC doesn't provide the hooks we need to support
      the right conversion rules.  As declaration attributes, they affect
      code generation but don't carry other semantics.  */
-  { "mips16", 	   0, 0, true,  false, false, NULL },
-  { "nomips16",    0, 0, true,  false, false, NULL },
+  { "mips16", 	   0, 0, true,  false, false, NULL, false },
+  { "nomips16",    0, 0, true,  false, false, NULL, false },
   /* Allow functions to be specified as interrupt handlers */
-  { "interrupt",   0, 0, false, true,  true, NULL },
-  { "use_shadow_register_set",	0, 0, false, true,  true, NULL },
-  { "keep_interrupts_masked",	0, 0, false, true,  true, NULL },
-  { "use_debug_exception_return", 0, 0, false, true,  true, NULL },
-  { NULL,	   0, 0, false, false, false, NULL }
+  { "interrupt",   0, 0, false, true,  true, NULL, false },
+  { "use_shadow_register_set",	0, 0, false, true,  true, NULL, false },
+  { "keep_interrupts_masked",	0, 0, false, true,  true, NULL, false },
+  { "use_debug_exception_return", 0, 0, false, true,  true, NULL, false },
+  { NULL,	   0, 0, false, false, false, NULL, false }
 };
 \f
 /* A table describing all the processors GCC knows about.  Names are
Index: gcc/gcc/config/rs6000/rs6000.c
===================================================================
--- gcc.orig/gcc/config/rs6000/rs6000.c	2011-03-16 16:33:54.116917200 +0100
+++ gcc/gcc/config/rs6000/rs6000.c	2011-03-17 17:53:02.279518500 +0100
@@ -1303,16 +1303,22 @@ static const char alt_reg_names[][8] =
 
 static const struct attribute_spec rs6000_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "altivec",   1, 1, false, true,  false, rs6000_handle_altivec_attribute },
-  { "longcall",  0, 0, false, true,  true,  rs6000_handle_longcall_attribute },
-  { "shortcall", 0, 0, false, true,  true,  rs6000_handle_longcall_attribute },
-  { "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute },
-  { "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute },
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "altivec",   1, 1, false, true,  false, rs6000_handle_altivec_attribute,
+    false },
+  { "longcall",  0, 0, false, true,  true,  rs6000_handle_longcall_attribute,
+    false },
+  { "shortcall", 0, 0, false, true,  true,  rs6000_handle_longcall_attribute,
+    false },
+  { "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
+    false },
+  { "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute,
+    false },
 #ifdef SUBTARGET_ATTRIBUTE_TABLE
   SUBTARGET_ATTRIBUTE_TABLE,
 #endif
-  { NULL,        0, 0, false, false, false, NULL }
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
Index: gcc/gcc/config/rx/rx.c
===================================================================
--- gcc.orig/gcc/config/rx/rx.c	2011-02-15 18:57:40.329638400 +0100
+++ gcc/gcc/config/rx/rx.c	2011-03-17 17:53:02.349027300 +0100
@@ -2237,11 +2237,15 @@ rx_handle_func_attribute (tree * node,
 /* Table of RX specific attributes.  */
 const struct attribute_spec rx_attribute_table[] =
 {
-  /* Name, min_len, max_len, decl_req, type_req, fn_type_req, handler.  */
-  { "fast_interrupt", 0, 0, true, false, false, rx_handle_func_attribute },
-  { "interrupt",      0, 0, true, false, false, rx_handle_func_attribute },
-  { "naked",          0, 0, true, false, false, rx_handle_func_attribute },
-  { NULL,             0, 0, false, false, false, NULL }
+  /* Name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+     affects_type_identity.  */
+  { "fast_interrupt", 0, 0, true, false, false, rx_handle_func_attribute,
+    false },
+  { "interrupt",      0, 0, true, false, false, rx_handle_func_attribute,
+    false },
+  { "naked",          0, 0, true, false, false, rx_handle_func_attribute,
+    false },
+  { NULL,             0, 0, false, false, false, NULL, false }
 };
 
 /* Extra processing for target specific command line options.  */
Index: gcc/gcc/config/sh/sh.c
===================================================================
--- gcc.orig/gcc/config/sh/sh.c	2011-01-02 10:22:44.477561000 +0100
+++ gcc/gcc/config/sh/sh.c	2011-03-17 17:53:02.407034700 +0100
@@ -306,15 +306,24 @@ static void sh_conditional_register_usag
 \f
 static const struct attribute_spec sh_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt_handler", 0, 0, true,  false, false, sh_handle_interrupt_handler_attribute },
-  { "sp_switch",         1, 1, true,  false, false, sh_handle_sp_switch_attribute },
-  { "trap_exit",         1, 1, true,  false, false, sh_handle_trap_exit_attribute },
-  { "renesas",           0, 0, false, true, false, sh_handle_renesas_attribute },
-  { "trapa_handler",     0, 0, true,  false, false, sh_handle_interrupt_handler_attribute },
-  { "nosave_low_regs",   0, 0, true,  false, false, sh_handle_interrupt_handler_attribute },
-  { "resbank",           0, 0, true,  false, false, sh_handle_resbank_handler_attribute },
-  { "function_vector",   1, 1, true,  false, false, sh2a_handle_function_vector_handler_attribute },
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "interrupt_handler", 0, 0, true,  false, false,
+    sh_handle_interrupt_handler_attribute, false },
+  { "sp_switch",         1, 1, true,  false, false,
+     sh_handle_sp_switch_attribute, false },
+  { "trap_exit",         1, 1, true,  false, false,
+    sh_handle_trap_exit_attribute, false },
+  { "renesas",           0, 0, false, true, false,
+    sh_handle_renesas_attribute, false },
+  { "trapa_handler",     0, 0, true,  false, false,
+    sh_handle_interrupt_handler_attribute, false },
+  { "nosave_low_regs",   0, 0, true,  false, false,
+    sh_handle_interrupt_handler_attribute, false },
+  { "resbank",           0, 0, true,  false, false,
+    sh_handle_resbank_handler_attribute, false },
+  { "function_vector",   1, 1, true,  false, false,
+    sh2a_handle_function_vector_handler_attribute, false },
 #ifdef SYMBIAN
   /* Symbian support adds three new attributes:
      dllexport - for exporting a function/variable that will live in a dll
@@ -323,10 +332,12 @@ static const struct attribute_spec sh_at
      Microsoft allows multiple declspecs in one __declspec, separating
      them with spaces.  We do NOT support this.  Instead, use __declspec
      multiple times.  */
-  { "dllimport",         0, 0, true,  false, false, sh_symbian_handle_dll_attribute },
-  { "dllexport",         0, 0, true,  false, false, sh_symbian_handle_dll_attribute },
+  { "dllimport",         0, 0, true,  false, false,
+    sh_symbian_handle_dll_attribute, false },
+  { "dllexport",         0, 0, true,  false, false,
+    sh_symbian_handle_dll_attribute, false },
 #endif
-  { NULL,                0, 0, false, false, false, NULL }
+  { NULL,                0, 0, false, false, false, NULL, false }
 };
 
 /* Set default optimization options.  */
Index: gcc/gcc/config/sol2.h
===================================================================
--- gcc.orig/gcc/config/sol2.h	2011-01-27 08:57:07.378678900 +0100
+++ gcc/gcc/config/sol2.h	2011-03-17 17:53:02.461541600 +0100
@@ -257,8 +257,8 @@ __enable_execute_stack (void *addr)
 /* #pragma init and #pragma fini are implemented on top of init and
    fini attributes.  */
 #define SOLARIS_ATTRIBUTE_TABLE						\
-  { "init",      0, 0, true,  false,  false, NULL },			\
-  { "fini",      0, 0, true,  false,  false, NULL }
+  { "init",      0, 0, true,  false,  false, NULL, false },		\
+  { "fini",      0, 0, true,  false,  false, NULL, false }
 
 /* Solaris/x86 as and gas support the common ELF .section/.pushsection
    syntax.  */
Index: gcc/gcc/config/sparc/sparc.c
===================================================================
--- gcc.orig/gcc/config/sparc/sparc.c	2011-03-12 17:04:42.161296400 +0100
+++ gcc/gcc/config/sparc/sparc.c	2011-03-17 17:53:02.505047100 +0100
@@ -469,9 +469,10 @@ static enum machine_mode sparc_preferred
 /* Table of valid machine attributes.  */
 static const struct attribute_spec sparc_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       do_diagnostic } */
   SUBTARGET_ATTRIBUTE_TABLE,
-  { NULL,        0, 0, false, false, false, NULL }
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 #endif
 \f
Index: gcc/gcc/config/spu/spu.c
===================================================================
--- gcc.orig/gcc/config/spu/spu.c	2011-02-07 19:08:06.397077100 +0100
+++ gcc/gcc/config/spu/spu.c	2011-03-17 17:53:02.572055600 +0100
@@ -293,10 +293,13 @@ spu_libgcc_shift_count_mode (void);
 /*  Table of machine attributes.  */
 static const struct attribute_spec spu_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "naked",          0, 0, true,  false, false, spu_handle_fndecl_attribute },
-  { "spu_vector",     0, 0, false, true,  false, spu_handle_vector_attribute },
-  { NULL,             0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "naked",          0, 0, true,  false, false, spu_handle_fndecl_attribute,
+    false },
+  { "spu_vector",     0, 0, false, true,  false, spu_handle_vector_attribute,
+    false },
+  { NULL,             0, 0, false, false, false, NULL, false }
 };
 \f
 /*  TARGET overrides.  */
Index: gcc/gcc/config/stormy16/stormy16.c
===================================================================
--- gcc.orig/gcc/config/stormy16/stormy16.c	2011-03-07 21:04:29.921052700 +0100
+++ gcc/gcc/config/stormy16/stormy16.c	2011-03-17 17:53:02.630563000 +0100
@@ -2170,11 +2170,15 @@ static tree xstormy16_handle_below100_at
 
 static const struct attribute_spec xstormy16_attribute_table[] =
 {
-  /* name, min_len, max_len, decl_req, type_req, fn_type_req, handler.  */
-  { "interrupt", 0, 0, false, true,  true,  xstormy16_handle_interrupt_attribute },
-  { "BELOW100",  0, 0, false, false, false, xstormy16_handle_below100_attribute },
-  { "below100",  0, 0, false, false, false, xstormy16_handle_below100_attribute },
-  { NULL,        0, 0, false, false, false, NULL }
+  /* name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+     affects_type_identity.  */
+  { "interrupt", 0, 0, false, true,  true,
+    xstormy16_handle_interrupt_attribute , false },
+  { "BELOW100",  0, 0, false, false, false,
+    xstormy16_handle_below100_attribute, false },
+  { "below100",  0, 0, false, false, false,
+    xstormy16_handle_below100_attribute, false },
+  { NULL,        0, 0, false, false, false, NULL, false }
 };
 
 /* Handle an "interrupt" attribute;
Index: gcc/gcc/config/v850/v850.c
===================================================================
--- gcc.orig/gcc/config/v850/v850.c	2011-01-02 10:22:44.630561000 +0100
+++ gcc/gcc/config/v850/v850.c	2011-03-17 17:53:02.662067000 +0100
@@ -3118,13 +3118,19 @@ v850_issue_rate (void)
 
 static const struct attribute_spec v850_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "interrupt_handler", 0, 0, true,  false, false, v850_handle_interrupt_attribute },
-  { "interrupt",         0, 0, true,  false, false, v850_handle_interrupt_attribute },
-  { "sda",               0, 0, true,  false, false, v850_handle_data_area_attribute },
-  { "tda",               0, 0, true,  false, false, v850_handle_data_area_attribute },
-  { "zda",               0, 0, true,  false, false, v850_handle_data_area_attribute },
-  { NULL,                0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "interrupt_handler", 0, 0, true,  false, false,
+    v850_handle_interrupt_attribute, false },
+  { "interrupt",         0, 0, true,  false, false,
+    v850_handle_interrupt_attribute, false },
+  { "sda",               0, 0, true,  false, false,
+    v850_handle_data_area_attribute, false },
+  { "tda",               0, 0, true,  false, false,
+    v850_handle_data_area_attribute, false },
+  { "zda",               0, 0, true,  false, false,
+    v850_handle_data_area_attribute, false },
+  { NULL,                0, 0, false, false, false, NULL, false }
 };
 \f
 /* Initialize the GCC target structure.  */
Index: gcc/gcc/cp/tree.c
===================================================================
--- gcc.orig/gcc/cp/tree.c	2011-03-06 12:15:04.854055100 +0100
+++ gcc/gcc/cp/tree.c	2011-03-17 17:53:02.693571000 +0100
@@ -2611,11 +2611,15 @@ zero_init_p (const_tree t)
 /* Table of valid C++ attributes.  */
 const struct attribute_spec cxx_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
-  { "java_interface", 0, 0, false, false, false, handle_java_interface_attribute },
-  { "com_interface",  0, 0, false, false, false, handle_com_interface_attribute },
-  { "init_priority",  1, 1, true,  false, false, handle_init_priority_attribute },
-  { NULL,	      0, 0, false, false, false, NULL }
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
+  { "java_interface", 0, 0, false, false, false,
+    handle_java_interface_attribute, false },
+  { "com_interface",  0, 0, false, false, false,
+    handle_com_interface_attribute, false },
+  { "init_priority",  1, 1, true,  false, false,
+    handle_init_priority_attribute, false },
+  { NULL,	      0, 0, false, false, false, NULL, false }
 };
 
 /* Handle a "java_interface" attribute; arguments as in
Index: gcc/gcc/doc/plugins.texi
===================================================================
--- gcc.orig/gcc/doc/plugins.texi	2011-01-02 10:22:44.688561000 +0100
+++ gcc/gcc/doc/plugins.texi	2011-03-17 17:53:02.742077200 +0100
@@ -331,7 +331,7 @@ handle_user_attribute (tree *node, tree
 
 /* Attribute definition */
 static struct attribute_spec user_attr =
-  @{ "user", 1, 1, false,  false, false, handle_user_attribute @};
+  @{ "user", 1, 1, false,  false, false, handle_user_attribute, false @};
 
 /* Plugin callback called during attribute registration.
 Registered with register_callback (plugin_name, PLUGIN_ATTRIBUTES, register_attributes, NULL)
Index: gcc/gcc/java/lang.c
===================================================================
--- gcc.orig/gcc/java/lang.c	2011-01-02 10:22:44.704561000 +0100
+++ gcc/gcc/java/lang.c	2011-03-17 17:53:02.764580100 +0100
@@ -75,8 +75,8 @@ static tree java_eh_personality (void);
 const struct attribute_spec java_attribute_table[] =
 {
  { "nonnull",                0, -1, false, true, true,
-			      NULL },
-  { NULL,                     0, 0, false, false, false, NULL }
+			      NULL, false },
+  { NULL,                     0, 0, false, false, false, NULL, false }
 };
 
 /* Used to avoid printing error messages with bogus function
Index: gcc/gcc/lto/lto-lang.c
===================================================================
--- gcc.orig/gcc/lto/lto-lang.c	2011-02-18 18:34:10.378345100 +0100
+++ gcc/gcc/lto/lto-lang.c	2011-03-17 17:53:02.786082800 +0100
@@ -52,29 +52,30 @@ static tree handle_format_arg_attribute
 /* Table of machine-independent attributes supported in GIMPLE.  */
 const struct attribute_spec lto_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       do_diagnostic } */
   { "noreturn",               0, 0, true,  false, false,
-			      handle_noreturn_attribute },
+			      handle_noreturn_attribute, false },
   { "leaf",		      0, 0, true,  false, false,
-			      handle_leaf_attribute },
+			      handle_leaf_attribute, false },
   /* The same comments as for noreturn attributes apply to const ones.  */
   { "const",                  0, 0, true,  false, false,
-			      handle_const_attribute },
+			      handle_const_attribute, false },
   { "malloc",                 0, 0, true,  false, false,
-			      handle_malloc_attribute },
+			      handle_malloc_attribute, false },
   { "pure",                   0, 0, true,  false, false,
-			      handle_pure_attribute },
+			      handle_pure_attribute, false },
   { "no vops",                0, 0, true,  false, false,
-			      handle_novops_attribute },
+			      handle_novops_attribute, false },
   { "nonnull",                0, -1, false, true, true,
-			      handle_nonnull_attribute },
+			      handle_nonnull_attribute, false },
   { "nothrow",                0, 0, true,  false, false,
-			      handle_nothrow_attribute },
+			      handle_nothrow_attribute, false },
   { "sentinel",               0, 1, false, true, true,
-			      handle_sentinel_attribute },
+			      handle_sentinel_attribute, false },
   { "type generic",           0, 0, false, true, true,
-			      handle_type_generic_attribute },
-  { NULL,                     0, 0, false, false, false, NULL }
+			      handle_type_generic_attribute, false },
+  { NULL,                     0, 0, false, false, false, NULL, false }
 };
 
 /* Give the specifications for the format attributes, used by C and all
@@ -82,12 +83,13 @@ const struct attribute_spec lto_attribut
 
 const struct attribute_spec lto_format_attribute_table[] =
 {
-  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
+       affects_type_identity } */
   { "format",                 3, 3, false, true,  true,
-			      handle_format_attribute },
+			      handle_format_attribute, false },
   { "format_arg",             1, 1, false, true,  true,
-			      handle_format_arg_attribute },
-  { NULL,                     0, 0, false, false, false, NULL }
+			      handle_format_arg_attribute, false },
+  { NULL,                     0, 0, false, false, false, NULL, false }
 };
 
 enum built_in_attribute
Index: gcc/gcc/testsuite/g++.dg/plugin/attribute_plugin.c
===================================================================
--- gcc.orig/gcc/testsuite/g++.dg/plugin/attribute_plugin.c	2011-01-02 10:22:44.737561000 +0100
+++ gcc/gcc/testsuite/g++.dg/plugin/attribute_plugin.c	2011-03-17 17:53:02.805085200 +0100
@@ -26,7 +26,7 @@ handle_user_attribute (tree *node, tree
 /* Attribute definition */
 
 static struct attribute_spec user_attr =
-  { "user", 1, 1, false,  false, false, handle_user_attribute };
+  { "user", 1, 1, false,  false, false, handle_user_attribute, false };
 
 /* Plugin callback called during attribute registration */
 
Index: gcc/gcc/tree.h
===================================================================
--- gcc.orig/gcc/tree.h	2011-03-12 17:04:44.605436200 +0100
+++ gcc/gcc/tree.h	2011-03-17 17:53:02.827088000 +0100
@@ -4329,6 +4329,8 @@ struct attribute_spec
      by the rest of this structure.  */
   tree (*const handler) (tree *node, tree name, tree args,
 				 int flags, bool *no_add_attrs);
+  /* Specifies if attribute affects type's identity.  */
+  const bool affects_type_identity;
 };
 
 /* Flags that may be passed in the third argument of decl_attributes, and

[-- Attachment #3: dispattr2.txt --]
[-- Type: text/plain, Size: 3547 bytes --]

Index: gcc/gcc/c-family/c-pretty-print.c
===================================================================
--- gcc.orig/gcc/c-family/c-pretty-print.c	2011-01-01 18:59:45.778898400 +0100
+++ gcc/gcc/c-family/c-pretty-print.c	2011-03-17 17:53:43.830794800 +0100
@@ -460,6 +460,7 @@ pp_c_specifier_qualifier_list (c_pretty_
 	  {
 	    pp_c_whitespace (pp);
 	    pp_c_left_paren (pp);
+	    pp_c_attributes_display (pp, TYPE_ATTRIBUTES (pointee));
 	  }
 	else if (!c_dialect_cxx ())
 	  pp_c_whitespace (pp);
@@ -790,6 +791,47 @@ pp_c_attributes (c_pretty_printer *pp, t
   pp_c_right_paren (pp);
 }
 
+/* Pretty-print ATTRIBUTES using GNU C extension syntax for attributes
+   marked to be displayed on disgnostic.  */
+
+void
+pp_c_attributes_display (c_pretty_printer *pp, tree a)
+{
+  bool is_first = true;
+
+  if (a == NULL_TREE)
+    return;
+
+  for (; a != NULL_TREE; a = TREE_CHAIN (a))
+    {
+      const struct attribute_spec *as;
+      as = lookup_attribute_spec (TREE_PURPOSE (a));
+      if (!as || as->affects_type_identity == false)
+        continue;
+      if (is_first)
+       {
+         pp_c_ws_string (pp, "__attribute__");
+         pp_c_left_paren (pp);
+         pp_c_left_paren (pp);
+         is_first = false;
+       }
+      else
+       {
+         pp_separate_with (pp, ',');
+       }
+      pp_tree_identifier (pp, TREE_PURPOSE (a));
+      if (TREE_VALUE (a))
+       pp_c_call_argument_list (pp, TREE_VALUE (a));
+    }
+
+  if (!is_first)
+    {
+      pp_c_right_paren (pp);
+      pp_c_right_paren (pp);
+      pp_c_whitespace (pp);
+    }
+}
+
 /* function-definition:
       declaration-specifiers declarator compound-statement  */
 
Index: gcc/gcc/c-family/c-pretty-print.h
===================================================================
--- gcc.orig/gcc/c-family/c-pretty-print.h	2011-01-04 20:35:36.271191800 +0100
+++ gcc/gcc/c-family/c-pretty-print.h	2011-03-17 17:53:43.858298300 +0100
@@ -177,6 +177,7 @@ void pp_c_space_for_pointer_operator (c_
 void pp_c_tree_decl_identifier (c_pretty_printer *, tree);
 void pp_c_function_definition (c_pretty_printer *, tree);
 void pp_c_attributes (c_pretty_printer *, tree);
+void pp_c_attributes_display (c_pretty_printer *, tree);
 void pp_c_cv_qualifiers (c_pretty_printer *pp, int qualifiers, bool func_type);
 void pp_c_type_qualifier_list (c_pretty_printer *, tree);
 void pp_c_parameter_type_list (c_pretty_printer *, tree);
Index: gcc/gcc/cp/cxx-pretty-print.c
===================================================================
--- gcc.orig/gcc/cp/cxx-pretty-print.c	2011-01-01 18:59:45.831898400 +0100
+++ gcc/gcc/cp/cxx-pretty-print.c	2011-03-17 17:53:43.876300600 +0100
@@ -1323,6 +1323,8 @@ pp_cxx_ptr_operator (cxx_pretty_printer
       if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE
 	  || TYPE_PTR_TO_MEMBER_P (TREE_TYPE (t)))
 	pp_cxx_ptr_operator (pp, TREE_TYPE (t));
+      pp_c_attributes_display (pp_c_base (pp),
+			       TYPE_ATTRIBUTES (TREE_TYPE (t)));
       if (TREE_CODE (t) == POINTER_TYPE)
 	{
 	  pp_star (pp);
Index: gcc/gcc/cp/error.c
===================================================================
--- gcc.orig/gcc/cp/error.c	2011-02-21 20:50:53.891928300 +0100
+++ gcc/gcc/cp/error.c	2011-03-17 17:53:43.906804500 +0100
@@ -661,6 +661,8 @@ dump_type_prefix (tree t, int flags)
 	  {
 	    pp_cxx_whitespace (cxx_pp);
 	    pp_cxx_left_paren (cxx_pp);
+	    pp_c_attributes_display (pp_c_base (cxx_pp),
+				     TYPE_ATTRIBUTES (sub));
 	  }
 	if (TREE_CODE (t) == POINTER_TYPE)
 	  pp_character(cxx_pp, '*');

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-03-17 17:03                     ` Kai Tietz
@ 2011-03-18 21:42                       ` Jason Merrill
  2011-03-21  8:34                         ` Kai Tietz
  0 siblings, 1 reply; 19+ messages in thread
From: Jason Merrill @ 2011-03-18 21:42 UTC (permalink / raw)
  To: Kai Tietz
  Cc: Gabriel Dos Reis, Joseph S. Myers, GCC Patches, Richard Henderson

OK.

Jason

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-03-18 21:42                       ` Jason Merrill
@ 2011-03-21  8:34                         ` Kai Tietz
  2011-03-21  9:25                           ` Gabriel Dos Reis
  0 siblings, 1 reply; 19+ messages in thread
From: Kai Tietz @ 2011-03-21  8:34 UTC (permalink / raw)
  To: Jason Merrill
  Cc: Gabriel Dos Reis, Joseph S. Myers, GCC Patches, Richard Henderson

2011/3/18 Jason Merrill <jason@redhat.com>:
> OK.
>
> Jason
>

Applied first part at rev. 171209. Second part at rev. 171210.

Kai

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message
  2011-03-21  8:34                         ` Kai Tietz
@ 2011-03-21  9:25                           ` Gabriel Dos Reis
  0 siblings, 0 replies; 19+ messages in thread
From: Gabriel Dos Reis @ 2011-03-21  9:25 UTC (permalink / raw)
  To: Kai Tietz; +Cc: Jason Merrill, Joseph S. Myers, GCC Patches, Richard Henderson

On Mon, Mar 21, 2011 at 3:33 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 2011/3/18 Jason Merrill <jason@redhat.com>:
>> OK.
>>
>> Jason
>>
>
> Applied first part at rev. 171209. Second part at rev. 171210.
>

thanks.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2011-03-21  9:25 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-22 19:58 [patch i386,c,c++]: PR/12171 - calling convention omitted in error message Kai Tietz
2010-12-23  8:33 ` Gabriel Dos Reis
2010-12-23 10:25   ` Jason Merrill
2010-12-23 11:28     ` Ian Lance Taylor
2010-12-23 13:34   ` Joseph S. Myers
2010-12-23 16:29     ` Gabriel Dos Reis
2011-01-01 18:07       ` Kai Tietz
2011-01-04 22:37         ` Jason Merrill
2011-01-05 11:14           ` Richard Guenther
2011-01-05 14:11             ` Jason Merrill
2011-03-17  8:46           ` Kai Tietz
2011-03-17 15:38             ` Jason Merrill
2011-03-17 16:08               ` Kai Tietz
2011-03-17 16:17                 ` Jason Merrill
2011-03-17 16:24                   ` Kai Tietz
2011-03-17 17:03                     ` Kai Tietz
2011-03-18 21:42                       ` Jason Merrill
2011-03-21  8:34                         ` Kai Tietz
2011-03-21  9:25                           ` Gabriel Dos Reis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).