rpms/gcc/devel gcc41-c++-gnu-inline-redecl.patch, NONE, 1.1 gcc41.spec, 1.178, 1.179

Jakub Jelinek (jakub) fedora-extras-commits at redhat.com
Mon Oct 1 21:33:23 UTC 2007


Author: jakub

Update of /cvs/pkgs/rpms/gcc/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22097

Modified Files:
	gcc41.spec 
Added Files:
	gcc41-c++-gnu-inline-redecl.patch 
Log Message:
4.1.2-30

gcc41-c++-gnu-inline-redecl.patch:

--- NEW FILE gcc41-c++-gnu-inline-redecl.patch ---
2007-10-01  Alexandre Oliva  <aoliva at redhat.com>

	* decl.c (duplicate_decls): Preserve linkage flags for mere
	redeclarations of gnu_inline definitions.

	* g++.dg/ext/gnu-inline-global-redecl.C: New.

--- gcc/cp/decl.c.orig	2007-09-28 00:02:33.000000000 -0300
+++ gcc/cp/decl.c	2007-10-01 16:33:10.000000000 -0300
@@ -1846,24 +1846,24 @@ duplicate_decls (tree newdecl, tree oldd
   new_template = NULL_TREE;
   if (DECL_LANG_SPECIFIC (newdecl) && DECL_LANG_SPECIFIC (olddecl))
     {
-      bool old_decl_gnu_inline;
+      bool new_redefines_gnu_inline = false;
 
-      if ((DECL_INTERFACE_KNOWN (olddecl)
-	   && TREE_CODE (olddecl) == FUNCTION_DECL)
-	  || (TREE_CODE (olddecl) == TEMPLATE_DECL
-	      && TREE_CODE (DECL_TEMPLATE_RESULT (olddecl)) == FUNCTION_DECL))
+      if (new_defines_function
+	  && ((DECL_INTERFACE_KNOWN (olddecl)
+	       && TREE_CODE (olddecl) == FUNCTION_DECL)
+	      || (TREE_CODE (olddecl) == TEMPLATE_DECL
+		  && (TREE_CODE (DECL_TEMPLATE_RESULT (olddecl))
+		      == FUNCTION_DECL))))
 	{
 	  tree fn = olddecl;
 
 	  if (TREE_CODE (fn) == TEMPLATE_DECL)
 	    fn = DECL_TEMPLATE_RESULT (olddecl);
 
-	  old_decl_gnu_inline = GNU_INLINE_P (fn) && DECL_INITIAL (fn);
+	  new_redefines_gnu_inline = GNU_INLINE_P (fn) && DECL_INITIAL (fn);
 	}
-      else
-	old_decl_gnu_inline = false;
 
-      if (!old_decl_gnu_inline)
+      if (!new_redefines_gnu_inline)
 	{
 	  DECL_INTERFACE_KNOWN (newdecl) |= DECL_INTERFACE_KNOWN (olddecl);
 	  DECL_NOT_REALLY_EXTERN (newdecl) |= DECL_NOT_REALLY_EXTERN (olddecl);
--- gcc/testsuite/g++.dg/ext/gnu-inline-global-redecl.C	1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/g++.dg/ext/gnu-inline-global-redecl.C	2007-10-01 16:45:49.000000000 -0300
@@ -0,0 +1,19 @@
+/* Test __attribute__((gnu_inline)).
+
+   Check that we don't get out-of-line definitions for extern inline
+   gnu_inline functions, regardless of redeclaration.
+
+ */
+
+/* { dg-do link } */
+/* { dg-options "-O" } */ // such that static functions are optimized out
+
+#include "gnu-inline-common.h"
+
+decl(extern, fn)
+gnuindef(fn, 0)
+decl(extern, fn)
+
+int main () {
+  fn ();
+}


Index: gcc41.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/gcc41.spec,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -r1.178 -r1.179
--- gcc41.spec	28 Sep 2007 21:27:06 -0000	1.178
+++ gcc41.spec	1 Oct 2007 21:32:51 -0000	1.179
@@ -1,6 +1,6 @@
 %define DATE 20070925
 %define gcc_version 4.1.2
-%define gcc_release 29
+%define gcc_release 30
 %define _unpackaged_files_terminate_build 0
 %define multilib_64_archs sparc64 ppc64 s390x x86_64
 %define include_gappletviewer 1
@@ -146,6 +146,7 @@
 Patch30: gcc41-pr20880.patch
 Patch31: gcc41-pr32694.patch
 Patch32: gcc41-virtual-inline-backtrace.patch
+Patch33: gcc41-c++-gnu-inline-redecl.patch
 
 # On ARM EABI systems, we do want -gnueabi to be part of the
 # target triple.
@@ -461,6 +462,7 @@
 %patch30 -p0 -b .pr20880~
 %patch31 -p0 -b .pr32694~
 %patch32 -p0 -b .virtual-inline-backtrace~
+%patch33 -p0 -b .c++-gnu-inline-redecl~
 
 sed -i -e 's/4\.1\.3/4.1.2/' gcc/BASE-VER gcc/version.c
 sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c
@@ -1615,6 +1617,10 @@
 %doc rpm.doc/changelogs/libmudflap/ChangeLog*
 
 %changelog
+* Mon Oct  1 2007 Jakub Jelinek <jakub at redhat.com> 4.1.2-30
+- fix ICE on C++ gnu_inline function followed by prototype of the same
+  fn (Alexandre Oliva)
+
 * Fri Sep 28 2007 Jakub Jelinek <jakub at redhat.com> 4.1.2-29
 - print virtual inline backtrace in some diagnostic messages to help
   locate bugs reported with -D_FORTIFY_SOURCE{,=2}




More information about the fedora-extras-commits mailing list