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]

[FORTRAN PATCH] Sync f77's duplicate_decls with C's.


Back in July, I posted a patch entitled "Preserve noreturn attribute
of _Exit and _exit" that tidied some code in C's duplicate_decls.
http://gcc.gnu.org/ml/gcc-patches/2002-07/msg00313.html

I've recently discovered that exactly the same `clause' currently
exits in the FORTRAN front-end's copy of duplicate_decls, probably
caused by their shared heritage.  This patch is effectively a port
of the c-decl.c patch above to g77's f/com.c.

Ok.  The real motivation is that these lines in g77 are currently
(almost) the last remaining use of "DECL_BUILT_IN_NONANSI"...

The following patch has been tested on i686-pc-linux-gnu, with a
bootstrap of the C and FORTRAN front-ends, and running their test
suites with no new regressions.  My guess is that nobody's ever
tried (re)defining _exit in g77 to check whether the noreturn
attribute was preserved :>.

Ok for mainline?


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

	* com.c (duplicate_decls): Synchronize with C's duplicate_decls.


Index: com.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/com.c,v
retrieving revision 1.183
diff -c -3 -p -r1.183 com.c
*** com.c	12 Jan 2003 02:32:39 -0000	1.183
--- com.c	9 Mar 2003 14:56:32 -0000
***************
*** 1,5 ****
  /* com.c -- Implementation File (module.c template V1.0)
!    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
     Free Software Foundation, Inc.
     Contributed by James Craig Burley.

--- 1,5 ----
  /* com.c -- Implementation File (module.c template V1.0)
!    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
     Free Software Foundation, Inc.
     Contributed by James Craig Burley.

*************** duplicate_decls (tree newdecl, tree oldd
*** 13220,13228 ****
        COPY_DECL_RTL (olddecl, newdecl);

        /* Merge the type qualifiers.  */
-       if (DECL_BUILT_IN_NONANSI (olddecl) && TREE_THIS_VOLATILE (olddecl)
- 	  && !TREE_THIS_VOLATILE (newdecl))
- 	TREE_THIS_VOLATILE (olddecl) = 0;
        if (TREE_READONLY (newdecl))
  	TREE_READONLY (olddecl) = 1;
        if (TREE_THIS_VOLATILE (newdecl))
--- 13220,13225 ----

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]