From e90acd935ae25e9b11a6028f889db17c7760572a Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 29 Jul 2008 13:00:58 +0200 Subject: [PATCH] flags.h (flag_really_no_inline): Remove. * flags.h (flag_really_no_inline): Remove. * cgraph.c (cgraph_function_possibly_inlined_p): Simplify. * toplev.c (flag_really_no_inline): Remove. * c-cppbuiltin.c (c_cpp_builtins): Use flag_no_inline. * ipa-inline.c (cgraph_decide_inlining): Do not check flag_no_inline. (cgraph_decide_inlining_incrementally): Likewise. (compute_inline_parameters): Likewise. * opts.c (decode_options): Simplify. * c-opts.c (c_common_post_options): Do not set flag_no_inline. * common.opt (finline): Initialize to 1. * tree-inline.c (inlinable_function_p): Check flag_no_inline. * lang.c (java_post_options): Remove handling of flag_no_inline. * misc.c (gnat_post_options): Do not set flag_no_inline. * options.c (gfc_post_options): Do not set flag_no_inline. From-SVN: r138238 --- gcc/ChangeLog | 16 +++++++++++++++- gcc/ada/ChangeLog | 4 ++++ gcc/ada/misc.c | 3 --- gcc/c-cppbuiltin.c | 2 +- gcc/c-opts.c | 11 ----------- gcc/cgraph.c | 2 +- gcc/common.opt | 2 +- gcc/flags.h | 5 ----- gcc/fortran/ChangeLog | 4 ++++ gcc/fortran/options.c | 4 ---- gcc/ipa-inline.c | 12 +++--------- gcc/java/ChangeLog | 4 ++++ gcc/java/lang.c | 4 ---- gcc/opts.c | 15 +-------------- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/20040206-1.c | 2 +- gcc/toplev.c | 5 ----- gcc/tree-inline.c | 2 +- 18 files changed, 40 insertions(+), 61 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 296b56289b5..8f51561972e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,18 @@ -2008-07-29 Jan HUbicka +2008-07-29 Jan Hubicka + + * flags.h (flag_really_no_inline): Remove. + * cgraph.c (cgraph_function_possibly_inlined_p): Simplify. + * toplev.c (flag_really_no_inline): Remove. + * c-cppbuiltin.c (c_cpp_builtins): Use flag_no_inline. + * ipa-inline.c (cgraph_decide_inlining): Do not check flag_no_inline. + (cgraph_decide_inlining_incrementally): Likewise. + (compute_inline_parameters): Likewise. + * opts.c (decode_options): Simplify. + * c-opts.c (c_common_post_options): Do not set flag_no_inline. + * common.opt (finline): Initialize to 1. + * tree-inline.c (inlinable_function_p): Check flag_no_inline. + +2008-07-29 Jan Hubicka * predict.c (always_optimize_for_size_p): New function. (optimize_bb_for_size_p, optimize_bb_for_speed_p, diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a4859fd744e..611311c31e6 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2008-07-28 Jan Hubicka + + * misc.c (gnat_post_options): Do not set flag_no_inline. + 2008-07-28 Richard Guenther Merge from gimple-tuples-branch. diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index 006da96b2b7..02397d7f445 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -340,9 +340,6 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED) /* ??? The warning machinery is outsmarted by Ada. */ warn_unused_parameter = 0; - if (!flag_no_inline) - flag_no_inline = 1; - /* Force eliminate_unused_debug_types to 0 unless an explicit positive -f has been passed. This forces the default to 0 for Ada, which might differ from the common default. */ diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c index 57d00580d24..2d951fe450c 100644 --- a/gcc/c-cppbuiltin.c +++ b/gcc/c-cppbuiltin.c @@ -636,7 +636,7 @@ c_cpp_builtins (cpp_reader *pfile) if (fast_math_flags_set_p ()) cpp_define (pfile, "__FAST_MATH__"); - if (flag_really_no_inline) + if (flag_no_inline) cpp_define (pfile, "__NO_INLINE__"); if (flag_signaling_nans) cpp_define (pfile, "__SUPPORT_SNAN__"); diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 258101c39cf..8b31b8879e7 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -1018,10 +1018,6 @@ c_common_post_options (const char **pfilename) C_COMMON_OVERRIDE_OPTIONS; #endif - /* Use tree inlining. */ - if (!flag_no_inline) - flag_no_inline = 1; - /* By default we use C99 inline semantics in GNU99 or C99 mode. C99 inline semantics are not supported in GNU89 or C89 mode. */ if (flag_gnu89_inline == -1) @@ -1075,13 +1071,6 @@ c_common_post_options (const char **pfilename) if (warn_overlength_strings == -1 || c_dialect_cxx ()) warn_overlength_strings = 0; - /* Adjust various flags for C++ based on command-line settings. */ - if (c_dialect_cxx ()) - { - if (!flag_no_inline) - flag_no_inline = 1; - } - /* In C, -Wconversion enables -Wsign-conversion (unless disabled through -Wno-sign-conversion). While in C++, -Wsign-conversion needs to be requested explicitly. */ diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 51181cbe6a2..b5564b679d4 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1149,7 +1149,7 @@ bool cgraph_function_possibly_inlined_p (tree decl) { if (!cgraph_global_info_ready) - return !DECL_UNINLINABLE (decl) && !flag_really_no_inline; + return !DECL_UNINLINABLE (decl); return DECL_POSSIBLY_INLINED (decl); } diff --git a/gcc/common.opt b/gcc/common.opt index 5d730a8cbf4..08f95c228e6 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -581,7 +581,7 @@ Perform indirect inlining ; only when actually used. Used in conjunction with -g. Also ; does the right thing with #pragma interface. finline -Common Report Var(flag_no_inline,0) Init(2) +Common Report Var(flag_no_inline,0) Init(0) Pay attention to the \"inline\" keyword finline-small-functions diff --git a/gcc/flags.h b/gcc/flags.h index f4cc3aca69d..e797d95c885 100644 --- a/gcc/flags.h +++ b/gcc/flags.h @@ -169,11 +169,6 @@ extern int flag_pcc_struct_return; extern int flag_complex_method; -/* Nonzero means that we don't want inlining by virtue of -fno-inline, - not just because the tree inliner turned us off. */ - -extern int flag_really_no_inline; - /* Nonzero if we are only using compiler to check syntax errors. */ extern int rtl_dump_and_exit; diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b15bcfb7ade..872678d6e3a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +2008-07-29 Jan Hubicka + + * options.c (gfc_post_options): Do not set flag_no_inline. + 2008-07-29 Daniel Kraft PR fortran/36403 diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index 1f05f35359f..7b7916d4603 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -294,10 +294,6 @@ gfc_post_options (const char **pfilename) gfc_warning_now ("'-fd-lines-as-code' has no effect in free form"); } - /* Use tree inlining. */ - if (!flag_no_inline) - flag_no_inline = 1; - /* If -pedantic, warn about the use of GNU extensions. */ if (pedantic && (gfc_option.allow_std & GFC_STD_GNU) != 0) gfc_option.warn_std |= GFC_STD_GNU; diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 0ccaa6bb24f..ec3a2719ac2 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1159,16 +1159,14 @@ cgraph_decide_inlining (void) overall_insns - old_insns); } - if (!flag_really_no_inline) - cgraph_decide_inlining_of_small_functions (); + cgraph_decide_inlining_of_small_functions (); /* After this point, any edge discovery performed by indirect inlining is no good so let's give up. */ if (flag_indirect_inlining) free_all_ipa_structures_after_iinln (); - if (!flag_really_no_inline - && flag_inline_functions_called_once) + if (flag_inline_functions_called_once) { if (dump_file) fprintf (dump_file, "\nDeciding on functions called once:\n"); @@ -1407,9 +1405,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node, } /* Now do the automatic inlining. */ - if (!flag_really_no_inline - && mode != INLINE_ALL - && mode != INLINE_ALWAYS_INLINE) + if (mode != INLINE_ALL && mode != INLINE_ALWAYS_INLINE) for (e = node->callees; e; e = e->next_callee) { if (!e->callee->local.inlinable @@ -1596,8 +1592,6 @@ compute_inline_parameters (struct cgraph_node *node) if (node->local.inlinable && !node->local.disregard_inline_limits) node->local.disregard_inline_limits = DECL_DISREGARD_INLINE_LIMITS (current_function_decl); - if (flag_really_no_inline && !node->local.disregard_inline_limits) - node->local.inlinable = 0; /* Inlining characteristics are maintained by the cgraph_mark_inline. */ node->global.insns = inline_summary (node)->self_insns; return 0; diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index a2c3cca3e12..022cff0d0c5 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2008-07-29 Jan Hubicka + + * lang.c (java_post_options): Remove handling of flag_no_inline. + 2008-07-28 Richard Guenther Merge from gimple-tuples-branch. diff --git a/gcc/java/lang.c b/gcc/java/lang.c index dde1b76573c..27383762add 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -532,10 +532,6 @@ java_post_options (const char **pfilename) { const char *filename = *pfilename; - /* Use tree inlining. */ - if (!flag_no_inline) - flag_no_inline = 1; - /* An absolute requirement: if we're not using indirect dispatch, we must always verify everything. */ if (! flag_indirect_dispatch) diff --git a/gcc/opts.c b/gcc/opts.c index 2a88ce2d138..13a7de1709f 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1072,24 +1072,14 @@ decode_options (unsigned int argc, const char **argv) flag_pic = flag_pie; if (flag_pic && !flag_pie) flag_shlib = 1; - - if (flag_no_inline == 2) - flag_no_inline = 0; - else - flag_really_no_inline = flag_no_inline; } - /* Set flag_no_inline before the post_options () hook. The C front - ends use it to determine tree inlining defaults. FIXME: such - code should be lang-independent when all front ends use tree - inlining, in which case it, and this condition, should be moved - to the top of process_options() instead. */ if (optimize == 0) { /* Inlining does not work if not optimizing, so force it not to be done. */ - flag_no_inline = 1; warn_inline = 0; + flag_no_inline = 1; /* The c_decode_option function and decode_option hook set this to `2' if -Wall is used, so we can avoid giving out @@ -1099,9 +1089,6 @@ decode_options (unsigned int argc, const char **argv) "-Wuninitialized is not supported without -O"); } - if (flag_really_no_inline == 2) - flag_really_no_inline = flag_no_inline; - /* The optimization to partition hot and cold basic blocks into separate sections of the .o and executable files does not work (currently) with exception handling. This is because there is no support for diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ed53441e077..cba3ac04df1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-07-29 Jan Hubicka + + * gcc.dg/20040206-1.c: Expect frontend warning now. + 2008-07-29 Manuel Lopez-Ibanez PR 34985 diff --git a/gcc/testsuite/gcc.dg/20040206-1.c b/gcc/testsuite/gcc.dg/20040206-1.c index b4b509bfc7e..c9c776f0bd0 100644 --- a/gcc/testsuite/gcc.dg/20040206-1.c +++ b/gcc/testsuite/gcc.dg/20040206-1.c @@ -7,5 +7,5 @@ The warning about "no return statement in function returning non-void" is PR 13000. */ -static int foo (int a __attribute__((unused)) ) { } /* { dg-warning "control reaches end of non-void" } */ +static int foo (int a __attribute__((unused)) ) { } /* { dg-warning "no return statement" } */ int main (void) { return foo (0); } diff --git a/gcc/toplev.c b/gcc/toplev.c index d021eeea32c..d717ebace2a 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -245,11 +245,6 @@ int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN; int flag_complex_method = 1; -/* Nonzero means that we don't want inlining by virtue of -fno-inline, - not just because the tree inliner turned us off. */ - -int flag_really_no_inline = 2; - /* Nonzero means we should be saving declaration info into a .X file. */ int flag_gen_aux_info = 0; diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 511270bffb3..a10586128e8 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2554,7 +2554,7 @@ inlinable_function_p (tree fn) always_inline = lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)); - if (flag_really_no_inline + if (flag_no_inline && always_inline == NULL) { if (do_warning) -- 2.30.2