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]: Add some noreturn attributes


Bootstrapping with -Wmissing-noreturn revealed a few more places where
we could take advantage of the noreturn attribute in GCC.  These
functions are called when "enable checking" finds a problem and they
ultimately abort.  Using the attribute shaves 39k from the text
segment of cc1plus and 6.5k off of genattrtab, (when checking is
enabled.)  More Kb when you include debugging info.

Bootstrapped with --enable-languages=c++ on x86_64-unknown-linux-gnu.
Full bootstrap/regtest underway.

Okay for mainline when we're un-slushed?

		Thanks,
		--Kaveh


2005-05-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* genautomata.c (decl_mode_check_failed,
	regexp_mode_check_failed): Add noreturn attribute.

cp:
	* cp-tree.h (lang_check_failed): Add noreturn attribute.

diff -rup orig/egcc-CVS20050519/gcc/cp/cp-tree.h egcc-CVS20050519/gcc/cp/cp-tree.h
--- orig/egcc-CVS20050519/gcc/cp/cp-tree.h	2005-05-17 21:19:57.000000000 -0400
+++ egcc-CVS20050519/gcc/cp/cp-tree.h	2005-05-20 22:21:10.000000000 -0400
@@ -4157,7 +4157,7 @@ extern void note_decl_for_pch           
 
 /* in tree.c */
 extern void lang_check_failed			(const char *, int,
-							 const char *);
+						 const char *) ATTRIBUTE_NORETURN;
 extern tree stabilize_expr			(tree, tree *);
 extern void stabilize_call			(tree, tree *);
 extern bool stabilize_init			(tree, tree *);
diff -rup orig/egcc-CVS20050519/gcc/genautomata.c egcc-CVS20050519/gcc/genautomata.c
--- orig/egcc-CVS20050519/gcc/genautomata.c	2005-04-24 08:38:45.000000000 -0400
+++ egcc-CVS20050519/gcc/genautomata.c	2005-05-20 22:18:39.000000000 -0400
@@ -1357,7 +1357,8 @@ struct state_ainsn_table
 
 static const char *decl_name (enum decl_mode);
 static void decl_mode_check_failed (enum decl_mode, const char *,
-				    const char *, int, const char *);
+				    const char *, int, const char *)
+     ATTRIBUTE_NORETURN;
 
 /* Return string representation of declaration mode MODE.  */
 static const char *
@@ -1445,7 +1446,7 @@ decl_mode_check_failed (enum decl_mode m
 static const char *regexp_name (enum regexp_mode);
 static void regexp_mode_check_failed (enum regexp_mode, const char *,
 				      const char *, int,
-				      const char *);
+				      const char *) ATTRIBUTE_NORETURN;
 
 
 /* Return string representation of regexp mode MODE.  */


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