aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1997-10-26 16:56:15 +0000
committerJeff Law <law@gcc.gnu.org>1997-10-26 09:56:15 -0700
commit6d6d0fa07e124c351a01f4cadcfc16ef215817ad (patch)
tree724455a715ab23442474adb49157e2a8343b4856 /gcc
parentda0af5a56fc0b83f9c7f7eaa4038a4a627f4cfbc (diff)
downloadgcc-6d6d0fa07e124c351a01f4cadcfc16ef215817ad.zip
gcc-6d6d0fa07e124c351a01f4cadcfc16ef215817ad.tar.gz
gcc-6d6d0fa07e124c351a01f4cadcfc16ef215817ad.tar.bz2
toplev.c (flag_rerun_loop_opt): New variable.
* toplev.c (flag_rerun_loop_opt): New variable. (f_options): Handle -frerun-loop-opt. (rest_of_compilation): If -frerun-loop-opt, then run the loop optimizer twice. (main): Enable -frerun-loop-opt by default for -O2 or greater. From-SVN: r16180
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/invoke.texi25
-rw-r--r--gcc/toplev.c27
3 files changed, 57 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a1b6628..9ad14ce 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
Sun Oct 26 09:21:40 1997 Jeffrey A Law (law@cygnus.com)
+ * toplev.c (flag_rerun_loop_opt): New variable.
+ (f_options): Handle -frerun-loop-opt.
+ (rest_of_compilation): If -frerun-loop-opt, then run the loop
+ optimizer twice.
+ (main): Enable -frerun-loop-opt by default for -O2 or greater.
+
* loop.c (simplify_giv_expr): Adding two invariants results
in an invariant.
diff --git a/gcc/invoke.texi b/gcc/invoke.texi
index 5934a43..34ec218 100644
--- a/gcc/invoke.texi
+++ b/gcc/invoke.texi
@@ -149,7 +149,7 @@ in the following sections.
-fkeep-inline-functions -fno-default-inline
-fno-defer-pop -fno-function-cse
-fno-inline -fno-peephole -fomit-frame-pointer -fregmove
--frerun-cse-after-loop -fschedule-insns
+-frerun-cse-after-loop -frerun-loop-opt -fschedule-insns
-fschedule-insns2 -fstrength-reduce -fthread-jumps
-funroll-all-loops -funroll-loops
-fmove-all-movables -freduce-all-givs
@@ -245,6 +245,10 @@ in the following sections.
-msoft-float -mhard-float
-mbsd -mxopen -mno-symrename
+@emph{MN10300 Options}
+-mmult-bug
+-mno-mult-bug
+
@emph{M32R/D Options}
-mcode-model=@var{model type} -msdata=@var{sdata type}
-G @var{num}
@@ -2165,6 +2169,9 @@ body of the @code{if}.
Re-run common subexpression elimination after loop optimizations has been
performed.
+@item -frerun-loop-opt
+Run the loop optimizer twice.
+
@item -fexpensive-optimizations
Perform a number of minor optimizations that are relatively expensive.
@@ -2798,6 +2805,7 @@ that macro, which enables you to change the defaults.
* Convex Options::
* AMD29K Options::
* ARM Options::
+* MN10300 Options::
* M32R/D Options::
* M88K Options::
* RS/6000 and PowerPC Options::
@@ -3437,6 +3445,21 @@ suppresses this pass. The post-processor is never run when the
compiler is built for cross-compilation.
@end table
+@node MN10300 Options
+@subsection MN10300 Options
+@cindex MN10300 options
+These @samp{-m} options are defined for Matsushita MN10300 architectures:
+
+@table @code
+@item -mmult-bug
+Generate code to avoid bugs in the multiply instructions for the MN10300
+processors. This is the default.
+
+@item -mno-mult-bug
+Do not generate code to avoid bugs in the multiply instructions for the
+MN10300 processors.
+@end table
+
@node M32R/D Options
@subsection M32R/D Options
@cindex M32R/D options
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 9fabc8f..c36554f 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -505,6 +505,10 @@ int flag_syntax_only = 0;
static int flag_rerun_cse_after_loop;
+/* Nonzero means to run loop optimizations twice. */
+
+static int flag_rerun_loop_opt;
+
/* Nonzero for -finline-functions: ok to inline functions that look like
good inline candidates. */
@@ -707,6 +711,7 @@ struct { char *string; int *variable; int on_value;} f_options[] =
{"reg-struct-return", &flag_pcc_struct_return, 0},
{"delayed-branch", &flag_delayed_branch, 1},
{"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1},
+ {"rerun-loop-opt", &flag_rerun_loop_opt, 1},
{"pretend-float", &flag_pretend_float, 1},
{"schedule-insns", &flag_schedule_insns, 1},
{"schedule-insns2", &flag_schedule_insns_after_reload, 1},
@@ -3262,6 +3267,27 @@ rest_of_compilation (decl)
{
TIMEVAR (loop_time,
{
+ int save_flag_unroll_loops;
+ int save_flag_unroll_all_loops;
+
+ if (flag_rerun_loop_opt)
+ {
+ /* We only want to perform unrolling once. */
+ save_flag_unroll_loops = flag_unroll_loops;
+ save_flag_unroll_all_loops = flag_unroll_all_loops;
+ flag_unroll_loops = 0;
+ flag_unroll_all_loops = 0;
+
+ loop_optimize (insns, loop_dump_file);
+
+ /* The regscan pass may not be necessary, but let's
+ be safe until we can prove otherwise. */
+ reg_scan (insns, max_reg_num (), 1);
+
+ /* Restore loop unrolling flags. */
+ flag_unroll_loops = save_flag_unroll_loops;
+ flag_unroll_all_loops = save_flag_unroll_all_loops;
+ }
loop_optimize (insns, loop_dump_file);
});
}
@@ -3819,6 +3845,7 @@ main (argc, argv, envp)
flag_expensive_optimizations = 1;
flag_strength_reduce = 1;
flag_rerun_cse_after_loop = 1;
+ flag_rerun_loop_opt = 1;
flag_caller_saves = 1;
flag_force_mem = 1;
#ifdef INSN_SCHEDULING