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


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

[PATCH] [committed] Fix TYPE_READONLY vs TREE_READONLY in handle_noreturn_attribute


This fixes a regression caused by Kenner's patch to test for types
in the readonly field.

I saw this while compiling CVS gdb on i686.

Commited as obvious.


ChangeLog: 2004-04-09 Andrew Pinski <pinskia@physics.uc.edu>

* c-common.c (handle_noreturn_attribute): Use TYPE_READONLY instead
of TREE_READONLY for types.
2004-04-09 Andrew Pinski <pinskia@physics.uc.edu>


* gcc.dg/20040409-1.c: New test.


Patch:


Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.494
diff -u -p -r1.494 c-common.c
--- c-common.c	1 Apr 2004 03:50:26 -0000	1.494
+++ c-common.c	9 Apr 2004 20:03:20 -0000
@@ -4315,7 +4315,7 @@ handle_noreturn_attribute (tree *node, t
     TREE_TYPE (*node)
       = build_pointer_type
 	(build_type_variant (TREE_TYPE (type),
-			     TREE_READONLY (TREE_TYPE (type)), 1));
+			     TYPE_READONLY (TREE_TYPE (type)), 1));
   else
     {
       warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
Index: testsuite/gcc.dg/20040409-1.c
===================================================================
RCS file: testsuite/gcc.dg/20040409-1.c
diff -N testsuite/gcc.dg/20040409-1.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gcc.dg/20040409-1.c	9 Apr 2004 20:03:29 -0000
@@ -0,0 +1,4 @@
+/* This tests to make sure that the attribute noreturn
+   can be used on function pointers. */
+
+int (*temp) (void) __attribute__((noreturn));


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