This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch -finstrument-functions for 3.4 branch (PR other/10584)


PR other/10584 points out that -finstrument-functions is broken in 3.4
when inlining functions.  The proper fix is to implement instrumenting
in trees rather than in RTL.  But since this problem is fixed on the
tree-ssa branch, it hardly seems worth worrying it for 3.4.

This patch simply disables function inlining when using
-finstrument-functions on the 3.4 branch.  That will let
-finstrument-functions continue to work, albeit with less
optimization.  I think the alternatives are for somebody to spend the
time to actually fix this for 3.4--work which will then be discarded
when tree-ssa is merged--or to disable -finstrument-functions entirely
for 3.4.

I'm testing this by running the testsuite.  OK for 3.4 if the
testsuite passes?

Ian


2004-02-13  Ian Lance Taylor  <ian@wasabisystems.com>

	PR other/10584
	* c-opts.c (c_common_post_options): Disable function inlining when
	using -finstrument-functions.


Index: c-opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-opts.c,v
retrieving revision 1.96.4.5
diff -p -u -r1.96.4.5 c-opts.c
--- c-opts.c	10 Feb 2004 18:23:09 -0000	1.96.4.5
+++ c-opts.c	13 Feb 2004 17:06:48 -0000
@@ -1084,7 +1084,12 @@ c_common_post_options (const char **pfil
 
   /* Use tree inlining if possible.  Function instrumentation is only
      done in the RTL level, so we disable tree inlining.  */
-  if (! flag_instrument_function_entry_exit)
+  if (flag_instrument_function_entry_exit)
+    {
+      flag_no_inline = 1;
+      flag_really_no_inline = 1;
+    }
+  else
     {
       if (!flag_no_inline)
 	flag_no_inline = 1;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]