From 54dfd46bffb35c49935053bd9bc2997f77e26902 Mon Sep 17 00:00:00 2001
From: Jan Hubicka <jh@suse.cz>
Date: Tue, 29 Jul 2008 19:10:55 +0200
Subject: [PATCH] c-decl.c (merge_decls): Do not handle DECL_INLINE.

	* c-decl.c (merge_decls): Do not handle DECL_INLINE.
	(grokdeclarator): Likewise.
	* langhooks.c (lhd_warn_unused_global_decl): Use
	DECL_DECLARED_INLINE_P.
	* print-tree.c (print_node): Remove DECL_INLINE check.

From-SVN: r138258
---
 gcc/ChangeLog    |  8 ++++++++
 gcc/c-decl.c     | 36 ++++++------------------------------
 gcc/langhooks.c  |  2 +-
 gcc/print-tree.c |  3 +--
 4 files changed, 16 insertions(+), 33 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9d0388dd5aa9..406234289ea5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2008-07-29  Jan Hubicka  <jh@suse.cz>
+
+	* c-decl.c (merge_decls): Do not handle DECL_INLINE.
+	(grokdeclarator): Likewise.
+	* langhooks.c (lhd_warn_unused_global_decl): Use
+	DECL_DECLARED_INLINE_P.
+	* print-tree.c (print_node): Remove DECL_INLINE check.
+
 2008-07-29  Richard Guenther  <rguenther@suse.de>
 
 	PR tree-optimization/36945
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 7929aa8e2baf..ff23f6e4186a 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1786,7 +1786,6 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
 	    (*debug_hooks->outlining_inline_function) (olddecl);
 
 	  /* The new defn must not be inline.  */
-	  DECL_INLINE (newdecl) = 0;
 	  DECL_UNINLINABLE (newdecl) = 1;
 	}
       else
@@ -1841,22 +1840,10 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
 	  gimple_set_body (newdecl, gimple_body (olddecl));
 	  DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
 
-	  /* Set DECL_INLINE on the declaration if we've got a body
-	     from which to instantiate.  */
-	  if (DECL_INLINE (olddecl) && !DECL_UNINLINABLE (newdecl))
-	    {
-	      DECL_INLINE (newdecl) = 1;
-	      DECL_ABSTRACT_ORIGIN (newdecl)
-		= DECL_ABSTRACT_ORIGIN (olddecl);
-	    }
-	}
-      else
-	{
-	  /* If a previous declaration said inline, mark the
-	     definition as inlinable.  */
-	  if (DECL_DECLARED_INLINE_P (newdecl)
-	      && !DECL_UNINLINABLE (newdecl))
-	    DECL_INLINE (newdecl) = 1;
+	  /* See if we've got a function to instantiate from.  */
+	  if (DECL_SAVED_TREE (olddecl))
+	    DECL_ABSTRACT_ORIGIN (newdecl)
+	      = DECL_ABSTRACT_ORIGIN (olddecl);
 	}
     }
 
@@ -4851,19 +4838,8 @@ grokdeclarator (const struct c_declarator *declarator,
 	      pedwarn (0, "cannot inline function %<main%>");
 	  }
 	else if (declspecs->inline_p)
-	  {
-	    /* Record that the function is declared `inline'.  */
-	    DECL_DECLARED_INLINE_P (decl) = 1;
-
-	    /* Do not mark bare declarations as DECL_INLINE.  Doing so
-	       in the presence of multiple declarations can result in
-	       the abstract origin pointing between the declarations,
-	       which will confuse dwarf2out.  */
-	    if (initialized)
-	      DECL_INLINE (decl) = 1;
-	  }
-	else if (initialized)
-	  DECL_INLINE (decl) = 1;
+	  /* Record that the function is declared `inline'.  */
+	  DECL_DECLARED_INLINE_P (decl) = 1;
       }
     else
       {
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 2285ac17f54a..30e5bfa9f61a 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -133,7 +133,7 @@ lhd_warn_unused_global_decl (const_tree decl)
   /* This is what used to exist in check_global_declarations.  Probably
      not many of these actually apply to non-C languages.  */
 
-  if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
+  if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
     return false;
   if (TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl))
     return false;
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index a310ec436e24..b76a180fbdb1 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -461,8 +461,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
 	  print_node (file, "size", DECL_SIZE (node), indent + 4);
 	  print_node (file, "unit size", DECL_SIZE_UNIT (node), indent + 4);
 	  
-	  if (TREE_CODE (node) != FUNCTION_DECL
-	      || DECL_INLINE (node) || DECL_BUILT_IN (node))
+	  if (TREE_CODE (node) != FUNCTION_DECL || DECL_BUILT_IN (node))
 	    indent_to (file, indent + 3);
 	  
 	  if (DECL_USER_ALIGN (node))
-- 
GitLab