This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][3.3] PR 7257 (flag_inline_functions doesn't show up with-fverbose-asm)
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: gcc-patches at gcc dot gnu dot org
- Cc: aj at suse dot de
- Date: 05 Apr 2003 15:13:36 +0200
- Subject: [PATCH][3.3] PR 7257 (flag_inline_functions doesn't show up with-fverbose-asm)
Eric Botcazou posted a patch for this PR
(http://gcc.gnu.org/ml/gcc-patches/2003-02/msg00888.html)
that was rejected by Zack (apparently off-list).
After that, the PR got orphaned, so I picked it up.
I discussed the problem a bit with Eric, and he thinks there
should be a flag_inline_rtl flag, but I'm not sure. The RTL
inliner should never be doing anything if all functions are
considered for tree inlining. So I don't think the extra
flag is necessary. All we really need to do is set
flag_inline_functions to zero if the front end indicated that
it will consider all functions for tree inlining. We do so
now, just in the wrong place.
Without this patch, the front ends set flag_inline_functions
to zero, but they do so *before* the flags are dumped to the
assembler file with -fverbose-asm. With this patch, the flag
is zeroed in toplev, *after* the flags have been dumped.
Bootstrapped and regtested on i[56]86-pc-linux-gnu.
OK for 3.3? Something like this should go in 3.2 and mainline
as well, but I haven't tested it there yet.
Greetz
Steven
2003-04-05 Steven Bosscher <steven at gcc dot gnu dot org>
PR c/7257
* tree-inline.c (flag_inline_trees): Move from here...
* toplev.c: ...to here. Update comment.
(lang_dependent_init): Set flag_inline_functions to 0 if
the front end will consider all functions for tree inlining.
(flag_inline_functions): Mention that flag_inline_trees may
override it.
* flags.h (flag_inline_functions): Ditto.
* c-opts.c (c_common_post_options): Don't clear
flag_inline_functions here.
* cp/decl.c (cxx_init_decl_processing): Ditto.
* java/lang.c (java_post_options): Ditto.
Index: java/lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lang.c,v
retrieving revision 1.114.2.1
diff -c -3 -p -r1.114.2.1 lang.c
*** java/lang.c 5 Jan 2003 15:03:25 -0000 1.114.2.1
--- java/lang.c 4 Apr 2003 16:36:07 -0000
*************** java_post_options ()
*** 840,846 ****
if (flag_inline_functions)
{
flag_inline_trees = 2;
- flag_inline_functions = 0;
}
}
--- 840,845 ----
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.965.2.35
diff -c -3 -p -r1.965.2.35 decl.c
*** cp/decl.c 18 Mar 2003 15:57:07 -0000 1.965.2.35
--- cp/decl.c 4 Apr 2003 16:36:54 -0000
*************** cxx_init_decl_processing ()
*** 6625,6631 ****
if (flag_inline_functions)
{
flag_inline_trees = 2;
- flag_inline_functions = 0;
}
/* Force minimum function alignment if using the least significant
--- 6625,6630 ----
Index: c-opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-opts.c,v
retrieving revision 1.24.6.1
diff -c -3 -p -r1.24.6.1 c-opts.c
*** c-opts.c 21 Feb 2003 06:12:58 -0000 1.24.6.1
--- c-opts.c 4 Apr 2003 16:37:13 -0000
*************** c_common_post_options ()
*** 1376,1382 ****
if (flag_inline_functions)
{
flag_inline_trees = 2;
- flag_inline_functions = 0;
}
}
--- 1376,1381 ----
Index: flags.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flags.h,v
retrieving revision 1.93.4.1
diff -c -3 -p -r1.93.4.1 flags.h
*** flags.h 2 Apr 2003 07:14:27 -0000 1.93.4.1
--- flags.h 4 Apr 2003 16:37:15 -0000
*************** extern int flag_complex_divide_method;
*** 384,391 ****
extern int flag_rerun_loop_opt;
! /* Nonzero means make functions that look like good inline candidates
! go inline. */
extern int flag_inline_functions;
--- 384,392 ----
extern int flag_rerun_loop_opt;
!
! /* Nonzero for -finline-functions: ok to inline functions that look like
! good inline candidates. May be disabled when tree inlining. */
extern int flag_inline_functions;
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.690.2.15
diff -c -3 -p -r1.690.2.15 toplev.c
*** toplev.c 2 Apr 2003 07:14:28 -0000 1.690.2.15
--- toplev.c 4 Apr 2003 16:37:26 -0000
*************** static int flag_rerun_cse_after_loop;
*** 664,673 ****
int flag_rerun_loop_opt;
/* Nonzero for -finline-functions: ok to inline functions that look like
! good inline candidates. */
int flag_inline_functions;
/* Nonzero for -fkeep-inline-functions: even if we make a function
go inline everywhere, keep its definition around for debugging
purposes. */
--- 664,680 ----
int flag_rerun_loop_opt;
/* Nonzero for -finline-functions: ok to inline functions that look like
! good inline candidates. May be disabled when tree inlining. */
int flag_inline_functions;
+ /* 0 if we should not perform tree inlining.
+ 1 if we should expand functions calls inline at the tree level.
+ 2 if we should consider *all* functions to be tree inline
+ candidates. */
+
+ int flag_inline_trees = 0;
+
/* Nonzero for -fkeep-inline-functions: even if we make a function
go inline everywhere, keep its definition around for debugging
purposes. */
*************** lang_dependent_init (name)
*** 5241,5246 ****
--- 5249,5259 ----
main_input_filename = input_filename = name;
init_asm_output (name);
+ /* Disable the RTL inliner if the front end has indicated it will
+ use the tree inliner exclusively instead. */
+ if (flag_inline_trees == 2)
+ flag_inline_functions = 0;
+
/* These create various _DECL nodes, so need to be called after the
front end is initialized. */
init_eh ();
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.38.2.5
diff -c -3 -p -r1.38.2.5 tree-inline.c
*** tree-inline.c 14 Mar 2003 14:53:52 -0000 1.38.2.5
--- tree-inline.c 4 Apr 2003 16:37:29 -0000
*************** Boston, MA 02111-1307, USA. */
*** 45,57 ****
#include "java-tree.h"
#endif /* INLINER_FOR_JAVA */
- /* 0 if we should not perform inlining.
- 1 if we should expand functions calls inline at the tree level.
- 2 if we should consider *all* functions to be inline
- candidates. */
-
- int flag_inline_trees = 0;
-
/* To Do:
o In order to make inlining-on-trees work, we pessimized
--- 45,50 ----