re PR middle-end/18071 (-Winline does not respect -fno-default-inline)
authorJan Hubicka <jh@suse.cz>
Wed, 17 Sep 2008 15:00:59 +0000 (17:00 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 17 Sep 2008 15:00:59 +0000 (15:00 +0000)
PR c++/18071
* tree.h (DECL_INLINE): remove.
(DECL_DECLARED_INLINE_P): Update docs.
(DECL_NO_INLINE_WARNING_P): new.
(tree_function_decl): Replace inline_flag by no_inline_warning_flag.
* tree-inline.c (inlinable_function_p): Set DECL_NO_INLINE_WARNING_P.

Java:
* class.c (add_method_1): Do not initialize DECL_INLINE.
(make_local_function_alias): Likewise.
* expr.c (rewrite_arglist_getcaller): Set DECL_UNINLINABLE.
* lang.c (java_decl_ok_for_sibcall): Use DECL_UNINLINABLE.

Objc:
* objc/objc-act.c (objc_finish_method_definition): Do not set DECL_INLINE.

C++:
* cp/decl.c (start_method): Set DECL_NO_INLINE_WARNING_P.

From-SVN: r140418

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/java/ChangeLog
gcc/java/class.c
gcc/java/expr.c
gcc/java/lang.c
gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/tree-inline.c
gcc/tree.h

index a26bc96a5338bf8539b01172e0d208d8dad83ec0..9b763f828250a4e132a14ef0b2cf811dff23f5cd 100644 (file)
@@ -1,3 +1,12 @@
+2008-09-17  Jan Hubicka  <jh@suse.cz>
+
+       PR c++/18071
+       * tree.h (DECL_INLINE): remove.
+       (DECL_DECLARED_INLINE_P): Update docs.
+       (DECL_NO_INLINE_WARNING_P): new.
+       (tree_function_decl): Replace inline_flag by no_inline_warning_flag.
+       * tree-inline.c (inlinable_function_p): Set DECL_NO_INLINE_WARNING_P.
+
 2008-09-17  Jakub Jelinek  <jakub@redhat.com>
            Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
index a78e5f460be1a1f09c16860582d0aeaa4228f2cf..903f45cb411f564c00aa2f3b80f9ddb50761169f 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-17  Jan Hubicka  <jh@suse.cz>
+
+       PR c++/18071
+       * cp/decl.c (start_method): Set DECL_NO_INLINE_WARNING_P.
+
 2008-09-16  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/37531
index d699f89be32eb22ade8490d40f81987b432a4838..f57ca871254fb15a9c61453d6636b715c8730063 100644 (file)
@@ -12332,6 +12332,7 @@ start_method (cp_decl_specifier_seq *declspecs,
   check_template_shadow (fndecl);
 
   DECL_DECLARED_INLINE_P (fndecl) = 1;
+  DECL_NO_INLINE_WARNING_P (fndecl) = 1;
 
   /* We process method specializations in finish_struct_1.  */
   if (processing_template_decl && !DECL_TEMPLATE_SPECIALIZATION (fndecl))
index c88eca60d74121bd972ae8094b6d87fa3236b6ec..c5a9ecfc147c70fc0ff6de735e8f1fc9bb8c6764 100644 (file)
@@ -1,3 +1,11 @@
+2008-09-17  Jan Hubicka  <jh@suse.cz>
+
+       PR c++/18071
+       * class.c (add_method_1): Do not initialize DECL_INLINE.
+       (make_local_function_alias): Likewise.
+       * expr.c (rewrite_arglist_getcaller): Set DECL_UNINLINABLE.
+       * lang.c (java_decl_ok_for_sibcall): Use DECL_UNINLINABLE.
+
 2008-09-09  Richard Guenther  <rguenther@suse.de>
 
        * decl.c (build_result_decl): Remove no longer applicable
index 647da9ad23e48d1daaaa5e77880f33b2299ad076..13cc54e024d96be14ee7bec36c390726c93a8469 100644 (file)
@@ -795,7 +795,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
   if (access_flags & ACC_PUBLIC) METHOD_PUBLIC (fndecl) = 1;
   if (access_flags & ACC_PROTECTED) METHOD_PROTECTED (fndecl) = 1;
   if (access_flags & ACC_PRIVATE)
-    METHOD_PRIVATE (fndecl) = DECL_INLINE (fndecl) = 1;
+    METHOD_PRIVATE (fndecl) = 1;
   if (access_flags & ACC_NATIVE)
     {
       METHOD_NATIVE (fndecl) = 1;
@@ -806,9 +806,9 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
        file.  */
     DECL_EXTERNAL (fndecl) = CLASS_FROM_CURRENTLY_COMPILED_P (this_class) == 0;
   if (access_flags & ACC_STATIC) 
-    METHOD_STATIC (fndecl) = DECL_INLINE (fndecl) = 1;
+    METHOD_STATIC (fndecl) = 1;
   if (access_flags & ACC_FINAL) 
-    METHOD_FINAL (fndecl) = DECL_INLINE (fndecl) = 1;
+    METHOD_FINAL (fndecl) = 1;
   if (access_flags & ACC_SYNCHRONIZED) METHOD_SYNCHRONIZED (fndecl) = 1;
   if (access_flags & ACC_ABSTRACT) METHOD_ABSTRACT (fndecl) = 1;
   if (access_flags & ACC_STRICT) METHOD_STRICTFP (fndecl) = 1;
@@ -1393,7 +1393,6 @@ make_local_function_alias (tree method)
   TREE_PUBLIC (alias) = 0;
   DECL_EXTERNAL (alias) = 0;
   DECL_ARTIFICIAL (alias) = 1;
-  DECL_INLINE (alias) = 0;
   DECL_INITIAL (alias) = error_mark_node;
   TREE_ADDRESSABLE (alias) = 1;
   TREE_USED (alias) = 1;
index ff28bbb0b40984490eed52826a6bab87b4ddfd12..0882b520d5170f8890bedfeae7bf472e3fdaa2cc 100644 (file)
@@ -2089,9 +2089,9 @@ rewrite_arglist_getcaller (tree arglist)
   tree retaddr 
     = build_call_expr (built_in_decls[BUILT_IN_RETURN_ADDRESS],
                       1, integer_zero_node);
-  
-  DECL_INLINE (current_function_decl) = 0;
 
+  DECL_UNINLINABLE (current_function_decl) = 1;
+  
   return chainon (arglist, 
                  tree_cons (NULL_TREE, retaddr, 
                             NULL_TREE));
index d049aeb2bc162166d4b1da64d0cc3185f18e8c4c..af2ed8065c68dd88c78a75ea705ff24b0454ba39 100644 (file)
@@ -845,7 +845,7 @@ static bool
 java_decl_ok_for_sibcall (const_tree decl)
 {
   return (decl != NULL && DECL_CONTEXT (decl) == output_class
-         && DECL_INLINE (decl));
+          && !DECL_UNINLINABLE (decl));
 }
 
 /* Given a call_expr, try to figure out what its target might be.  In
index e4f952d847594d8e9dd7d48e4d616686ad8b3971..1457f7f49ab697449e1d031cd60426492603dd65 100644 (file)
@@ -1,3 +1,9 @@
+2008-09-17  Jan Hubicka  <jh@suse.cz>
+
+       PR c++/18071
+       * objc/objc-act.c (objc_finish_method_definition): Do not set
+       DECL_INLINE.
+
 2008-09-01  Aldy Hernandez  <aldyh@redhat.com>
 
        * objc-act.c (build_typed_selector_reference): Pass input_location to
index 8f9571942c27d210233eeb865465f4cf28abdb88..1fd52f0643577f258279270034151be1571f7249 100644 (file)
@@ -8800,7 +8800,6 @@ objc_finish_method_definition (tree fndecl)
   /* We cannot validly inline ObjC methods, at least not without a language
      extension to declare that a method need not be dynamically
      dispatched, so suppress all thoughts of doing so.  */
-  DECL_INLINE (fndecl) = 0;
   DECL_UNINLINABLE (fndecl) = 1;
 
 #ifndef OBJCPLUS
index ebc8b32916b4549f8cff301d3ff8908178179292..69f0c80c09433ae01f07da57c83a802f294ee541 100644 (file)
@@ -2594,6 +2594,7 @@ inlinable_function_p (tree fn)
   /* We only warn for functions declared `inline' by the user.  */
   do_warning = (warn_inline
                && DECL_DECLARED_INLINE_P (fn)
+               && !DECL_NO_INLINE_WARNING_P (fn)
                && !DECL_IN_SYSTEM_HEADER (fn));
 
   always_inline = lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn));
index 2dc3e6b9ec10bfc8681d4cd095e518a623640563..4c046c29d645289397bdb34fda464bf99246ac90 100644 (file)
@@ -3235,17 +3235,17 @@ struct tree_decl_non_common GTY(())
 #define DECL_POSSIBLY_INLINED(DECL) \
   FUNCTION_DECL_CHECK (DECL)->function_decl.possibly_inlined
 
-/* Nonzero in a FUNCTION_DECL means this function can be substituted
-   where it is called.  */
-#define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.inline_flag)
-
 /* Nonzero in a FUNCTION_DECL means that this function was declared inline,
    such as via the `inline' keyword in C/C++.  This flag controls the linkage
-   semantics of 'inline'; whether or not the function is inlined is
-   controlled by DECL_INLINE.  */
+   semantics of 'inline'  */
 #define DECL_DECLARED_INLINE_P(NODE) \
   (FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag)
 
+/* Nonzero in a FUNCTION_DECL means this function should not get
+   -Winline warnings.  */
+#define DECL_NO_INLINE_WARNING_P(NODE) \
+  (FUNCTION_DECL_CHECK (NODE)->function_decl.no_inline_warning_flag)
+
 /* Nonzero in a FUNCTION_DECL that should be always inlined by the inliner
    disregarding size and cost heuristics.  This is equivalent to using
    the always_inline attribute without the required diagnostics if the
@@ -3314,7 +3314,7 @@ struct tree_function_decl GTY(())
   unsigned declared_inline_flag : 1;
   unsigned regdecl_flag : 1;
 
-  unsigned inline_flag : 1;
+  unsigned no_inline_warning_flag : 1;
   unsigned no_instrument_function_entry_exit : 1;
   unsigned no_limit_stack : 1;
   unsigned disregard_inline_limits : 1;