Commit 0494626a by Jan Hubicka Committed by Jan Hubicka

re PR middle-end/18071 (-Winline does not respect -fno-default-inline)

	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
parent 1c1b0507
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> 2008-09-17 Jakub Jelinek <jakub@redhat.com>
Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
......
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> 2008-09-16 Jakub Jelinek <jakub@redhat.com>
PR c++/37531 PR c++/37531
......
...@@ -12332,6 +12332,7 @@ start_method (cp_decl_specifier_seq *declspecs, ...@@ -12332,6 +12332,7 @@ start_method (cp_decl_specifier_seq *declspecs,
check_template_shadow (fndecl); check_template_shadow (fndecl);
DECL_DECLARED_INLINE_P (fndecl) = 1; DECL_DECLARED_INLINE_P (fndecl) = 1;
DECL_NO_INLINE_WARNING_P (fndecl) = 1;
/* We process method specializations in finish_struct_1. */ /* We process method specializations in finish_struct_1. */
if (processing_template_decl && !DECL_TEMPLATE_SPECIALIZATION (fndecl)) if (processing_template_decl && !DECL_TEMPLATE_SPECIALIZATION (fndecl))
......
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> 2008-09-09 Richard Guenther <rguenther@suse.de>
* decl.c (build_result_decl): Remove no longer applicable * decl.c (build_result_decl): Remove no longer applicable
......
...@@ -795,7 +795,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type) ...@@ -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_PUBLIC) METHOD_PUBLIC (fndecl) = 1;
if (access_flags & ACC_PROTECTED) METHOD_PROTECTED (fndecl) = 1; if (access_flags & ACC_PROTECTED) METHOD_PROTECTED (fndecl) = 1;
if (access_flags & ACC_PRIVATE) if (access_flags & ACC_PRIVATE)
METHOD_PRIVATE (fndecl) = DECL_INLINE (fndecl) = 1; METHOD_PRIVATE (fndecl) = 1;
if (access_flags & ACC_NATIVE) if (access_flags & ACC_NATIVE)
{ {
METHOD_NATIVE (fndecl) = 1; METHOD_NATIVE (fndecl) = 1;
...@@ -806,9 +806,9 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type) ...@@ -806,9 +806,9 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
file. */ file. */
DECL_EXTERNAL (fndecl) = CLASS_FROM_CURRENTLY_COMPILED_P (this_class) == 0; DECL_EXTERNAL (fndecl) = CLASS_FROM_CURRENTLY_COMPILED_P (this_class) == 0;
if (access_flags & ACC_STATIC) if (access_flags & ACC_STATIC)
METHOD_STATIC (fndecl) = DECL_INLINE (fndecl) = 1; METHOD_STATIC (fndecl) = 1;
if (access_flags & ACC_FINAL) 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_SYNCHRONIZED) METHOD_SYNCHRONIZED (fndecl) = 1;
if (access_flags & ACC_ABSTRACT) METHOD_ABSTRACT (fndecl) = 1; if (access_flags & ACC_ABSTRACT) METHOD_ABSTRACT (fndecl) = 1;
if (access_flags & ACC_STRICT) METHOD_STRICTFP (fndecl) = 1; if (access_flags & ACC_STRICT) METHOD_STRICTFP (fndecl) = 1;
...@@ -1393,7 +1393,6 @@ make_local_function_alias (tree method) ...@@ -1393,7 +1393,6 @@ make_local_function_alias (tree method)
TREE_PUBLIC (alias) = 0; TREE_PUBLIC (alias) = 0;
DECL_EXTERNAL (alias) = 0; DECL_EXTERNAL (alias) = 0;
DECL_ARTIFICIAL (alias) = 1; DECL_ARTIFICIAL (alias) = 1;
DECL_INLINE (alias) = 0;
DECL_INITIAL (alias) = error_mark_node; DECL_INITIAL (alias) = error_mark_node;
TREE_ADDRESSABLE (alias) = 1; TREE_ADDRESSABLE (alias) = 1;
TREE_USED (alias) = 1; TREE_USED (alias) = 1;
......
...@@ -2089,9 +2089,9 @@ rewrite_arglist_getcaller (tree arglist) ...@@ -2089,9 +2089,9 @@ rewrite_arglist_getcaller (tree arglist)
tree retaddr tree retaddr
= build_call_expr (built_in_decls[BUILT_IN_RETURN_ADDRESS], = build_call_expr (built_in_decls[BUILT_IN_RETURN_ADDRESS],
1, integer_zero_node); 1, integer_zero_node);
DECL_INLINE (current_function_decl) = 0;
DECL_UNINLINABLE (current_function_decl) = 1;
return chainon (arglist, return chainon (arglist,
tree_cons (NULL_TREE, retaddr, tree_cons (NULL_TREE, retaddr,
NULL_TREE)); NULL_TREE));
......
...@@ -845,7 +845,7 @@ static bool ...@@ -845,7 +845,7 @@ static bool
java_decl_ok_for_sibcall (const_tree decl) java_decl_ok_for_sibcall (const_tree decl)
{ {
return (decl != NULL && DECL_CONTEXT (decl) == output_class 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 /* Given a call_expr, try to figure out what its target might be. In
......
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> 2008-09-01 Aldy Hernandez <aldyh@redhat.com>
* objc-act.c (build_typed_selector_reference): Pass input_location to * objc-act.c (build_typed_selector_reference): Pass input_location to
......
...@@ -8800,7 +8800,6 @@ objc_finish_method_definition (tree fndecl) ...@@ -8800,7 +8800,6 @@ objc_finish_method_definition (tree fndecl)
/* We cannot validly inline ObjC methods, at least not without a language /* We cannot validly inline ObjC methods, at least not without a language
extension to declare that a method need not be dynamically extension to declare that a method need not be dynamically
dispatched, so suppress all thoughts of doing so. */ dispatched, so suppress all thoughts of doing so. */
DECL_INLINE (fndecl) = 0;
DECL_UNINLINABLE (fndecl) = 1; DECL_UNINLINABLE (fndecl) = 1;
#ifndef OBJCPLUS #ifndef OBJCPLUS
......
...@@ -2594,6 +2594,7 @@ inlinable_function_p (tree fn) ...@@ -2594,6 +2594,7 @@ inlinable_function_p (tree fn)
/* We only warn for functions declared `inline' by the user. */ /* We only warn for functions declared `inline' by the user. */
do_warning = (warn_inline do_warning = (warn_inline
&& DECL_DECLARED_INLINE_P (fn) && DECL_DECLARED_INLINE_P (fn)
&& !DECL_NO_INLINE_WARNING_P (fn)
&& !DECL_IN_SYSTEM_HEADER (fn)); && !DECL_IN_SYSTEM_HEADER (fn));
always_inline = lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)); always_inline = lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn));
......
...@@ -3235,17 +3235,17 @@ struct tree_decl_non_common GTY(()) ...@@ -3235,17 +3235,17 @@ struct tree_decl_non_common GTY(())
#define DECL_POSSIBLY_INLINED(DECL) \ #define DECL_POSSIBLY_INLINED(DECL) \
FUNCTION_DECL_CHECK (DECL)->function_decl.possibly_inlined 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, /* 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 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 semantics of 'inline' */
controlled by DECL_INLINE. */
#define DECL_DECLARED_INLINE_P(NODE) \ #define DECL_DECLARED_INLINE_P(NODE) \
(FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag) (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 /* Nonzero in a FUNCTION_DECL that should be always inlined by the inliner
disregarding size and cost heuristics. This is equivalent to using disregarding size and cost heuristics. This is equivalent to using
the always_inline attribute without the required diagnostics if the the always_inline attribute without the required diagnostics if the
...@@ -3314,7 +3314,7 @@ struct tree_function_decl GTY(()) ...@@ -3314,7 +3314,7 @@ struct tree_function_decl GTY(())
unsigned declared_inline_flag : 1; unsigned declared_inline_flag : 1;
unsigned regdecl_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_instrument_function_entry_exit : 1;
unsigned no_limit_stack : 1; unsigned no_limit_stack : 1;
unsigned disregard_inline_limits : 1; unsigned disregard_inline_limits : 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment