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] PR c++/10031: Exception lists on builtins (take 2)


This patch is an alternate solution to the PR c++/10031 failures on
powerpc-linux and x86_64, based on Jason Merrill's suggestions that
we should use the type (and thereby the exception list) from the
first user specification.  This allows the user to prototype builtins
as "void exit(int) throw ()" or "void exit(int)", i.e. with or without
exception lists, provided that the choice is used consistently.


The following code has been tested on i686-pc-linux-gnu with a full
"make bootstrap", all languages except Ada and treelang, and a
top-level "make -k check" with no new regressions.  It also fixes
Michael Matz's test-vprintf.cpp testcaase with the cc1plus from a
cross-compiler from i686-pc-linux-gnu to powerpc-linux.


Sorry to ask a second time, could someone test this for me on
an affected platform where they can run the testsuite.  Ok for
mainline and 3.3 if there are no new regressions?  I think my
previous patch is still correct, but not necessarily the right
fix for this specific problem.



2003-03-14  Roger Sayle  <roger at eyesopen dot com>

	* decl.c (duplicate_decls): Use the new type when prototyping
	anticipated decls, even when the types match.  This defines the
	exception list for the built-in function.


Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1019
diff -c -3 -p -r1.1019 decl.c
*** decl.c	13 Mar 2003 19:57:10 -0000	1.1019
--- decl.c	14 Mar 2003 13:39:12 -0000
*************** duplicate_decls (tree newdecl, tree oldd
*** 3084,3089 ****
--- 3084,3093 ----
  	  /* Replace the old RTL to avoid problems with inlining.  */
  	  SET_DECL_RTL (olddecl, DECL_RTL (newdecl));
  	}
+       /* Even if the types match, prefer the new declarations type
+ 	 for anitipated built-ins, for exception lists, etc...  */
+       else if (DECL_ANTICIPATED (olddecl))
+ 	TREE_TYPE (olddecl) = TREE_TYPE (newdecl);

        if (DECL_THIS_STATIC (newdecl) && !DECL_THIS_STATIC (olddecl))
  	{

Roger
--
Roger Sayle,                         E-mail: roger at eyesopen dot com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


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