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] Fix PR c/7257


Hi,

This is a regression from gcc 2.95.3.

-finline-functions never appears in the assembly file when -fverbose-asm is 
specified on the command line (for example at -O3) because the front-ends 
using tree inlining disable its underlying flag flag_inline_functions (which 
commands RTL inlining). So I separated the interface part of the flag by 
adding a new one that is really tied to the -finline-functions option.

Bootstrapped/regtested (c,c++,objc,f77 3.3 branch) on i586-redhat-linux-gnu.
Ok for mainline and 3.3? for 3.2 too?

-- 
Eric Botcazou


2003-02-11  Eric Botcazou  <ebotcazou@libertysurf.fr>

	PR c/7257
	* toplev.c: New global flag_really_inline_functions.
	(f_options): Use it instead of flag_inline_functions.
	(parse_options_and_default_flags): Set it instead of
	flag_inline_functions at -O3.  Copy it in flag_inline_functions
	at the end of the parsing.


2003-02-11  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* gcc.dg/verbose-asm-2.c: New test.
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.690
diff -u -r1.690 toplev.c
--- toplev.c	9 Dec 2002 20:49:33 -0000	1.690
+++ toplev.c	11 Feb 2003 16:54:19 -0000
@@ -666,6 +666,10 @@
 /* Nonzero for -finline-functions: ok to inline functions that look like
    good inline candidates.  */
 
+int flag_really_inline_functions;
+
+/* Nonzero means that we want RTL inlining.  */
+
 int flag_inline_functions;
 
 /* Nonzero for -fkeep-inline-functions: even if we make a function
@@ -1025,7 +1029,7 @@
    N_("Copy memory address constants into regs before using") },
   {"function-cse", &flag_no_function_cse, 0,
    N_("Allow function addresses to be held in registers") },
-  {"inline-functions", &flag_inline_functions, 1,
+  {"inline-functions", &flag_really_inline_functions, 1,
    N_("Integrate simple functions into their callers") },
   {"keep-inline-functions", &flag_keep_inline_functions, 1,
    N_("Generate code for funcs even if they are fully inlined") },
@@ -4859,7 +4863,7 @@
 
   if (optimize >= 3)
     {
-      flag_inline_functions = 1;
+      flag_really_inline_functions = 1;
       flag_rename_registers = 1;
     }
 
@@ -4994,6 +4998,9 @@
 
   if (flag_really_no_inline == 2)
     flag_really_no_inline = flag_no_inline;
+ 
+  /* Assume RTL inlining by default.  */
+  flag_inline_functions = flag_really_inline_functions;
 }
 
 /* Process the options that have been parsed.  */
/* PR c/7257 */
/* { dg-do compile } */
/* { dg-options "-O3 -fverbose-asm" } */

/* Verify that -O3 -fverbose-asm does
   display -finline-functions. */

int foo(void)
{
  return 0;
}

/* { dg-final { scan-assembler "-finline-functions" } } */

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