This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Allow regmove to be turned off at -O2
- From: Steven Bosscher <stevenb at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 1 Jan 2005 20:00:23 +0100
- Subject: Allow regmove to be turned off at -O2
- Organization: SUSE Labs
Hi,
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?
Gr.
Steven
* 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