This is the mail archive of the 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]

Allow regmove to be turned off at -O2


The regmove pass runs when flag_regmove *or* flag_expensive_optimizations.
This means that it is not possible to turn off regmove at -O2.  I don't
understand why regmove should run if -fexpensive-optimizations is given,
the documentation for that flag doesn't say it turns on/off some passes:

@item -fexpensive-optimizations
@opindex fexpensive-optimizations
Perform a number of minor optimizations that are relatively expensive.

So IMHO we should not let -fexpensive-optimizations turn on regmove.  The
attached patch removes that bit from passes.c.  Bootstrapped and tested
as usual on x86_64-suse-linux-gnu.  OK?


	* passes.c (rest_of_compilation): Don't run regmove if only
	flag_expensive_optimizations, require flag_regmove instead.

Index: passes.c
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.60
diff -u -p -r2.60 passes.c
--- passes.c    14 Dec 2004 01:30:31 -0000      2.60
+++ passes.c    1 Jan 2005 18:54:33 -0000
@@ -1678,7 +1678,7 @@ rest_of_compilation (void)
       && !user_defined_section_attribute)
     rest_of_handle_partition_blocks ();

-  if (optimize > 0 && (flag_regmove || flag_expensive_optimizations))
+  if (optimize > 0 && flag_regmove)
     rest_of_handle_regmove ();

   /* Do unconditional splitting before register allocation to allow machine

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