This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Flag to disable SSA optimizers [patch]
- From: Diego Novillo <dnovillo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Jan 2003 16:55:04 -0500
- Subject: [tree-ssa] Flag to disable SSA optimizers [patch]
- Organization: Red Hat Canada
Adds -fdisable-tree-ssa. It prevents the initial call to
optimize_function_tree(). Useful only for debugging.
Diego.
* flags.h (flag_disable_tree_ssa): New flag.
* c-decl.c (c_expand_body): Use it.
* toplev.c: Declare it.
(f_options): Add help text for -fdisable-tree-ssa.
* doc/invoke.texi: Add documentation for -fdisable-tree-ssa.
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.334.2.35
diff -d -u -p -r1.334.2.35 c-decl.c
--- c-decl.c 28 Jan 2003 05:14:22 -0000 1.334.2.35
+++ c-decl.c 28 Jan 2003 21:44:51 -0000
@@ -6551,7 +6551,7 @@ c_expand_body (fndecl, nested_p, can_def
}
/* Invoke the SSA tree optimizer. */
- if (optimize >= 1)
+ if (optimize >= 1 && !flag_disable_tree_ssa)
optimize_function_tree (fndecl);
}
Index: flags.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flags.h,v
retrieving revision 1.86.2.15
diff -d -u -p -r1.86.2.15 flags.h
--- flags.h 29 Dec 2002 22:04:58 -0000 1.86.2.15
+++ flags.h 28 Jan 2003 21:44:51 -0000
@@ -659,6 +659,9 @@ extern int flag_mudflap;
/* Disable tree simplification. */
extern int flag_disable_simple;
+/* Disable SSA optimizations on trees. */
+extern int flag_disable_tree_ssa;
+
/* Enable SSA-PRE on trees. */
extern int flag_tree_pre;
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.654.2.38
diff -d -u -p -r1.654.2.38 toplev.c
--- toplev.c 17 Jan 2003 19:52:52 -0000 1.654.2.38
+++ toplev.c 28 Jan 2003 21:44:51 -0000
@@ -890,6 +890,9 @@ int flag_new_regalloc = 0;
/* Disable tree simplification. */
int flag_disable_simple = 0;
+/* Disable SSA on trees optimizations. */
+int flag_disable_tree_ssa = 0;
+
/* Enable the SSA-PRE tree optimization. */
int flag_tree_pre = 0;
@@ -1220,6 +1223,8 @@ static const lang_independent_options f_
N_("Use graph coloring register allocation.") },
{ "disable-simple", &flag_disable_simple, 1,
N_("Do not re-write trees into SIMPLE form") },
+ { "disable-tree-ssa", &flag_disable_tree_ssa, 1,
+ N_("Disable SSA optimizations on trees") },
{ "tree-pre", &flag_tree_pre, 1,
N_("Enable SSA-PRE optimization on trees") },
{ "tree-ccp", &flag_tree_ccp, 1,
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.152.2.31
diff -d -u -p -r1.152.2.31 invoke.texi
--- doc/invoke.texi 28 Jan 2003 05:14:23 -0000 1.152.2.31
+++ doc/invoke.texi 28 Jan 2003 21:44:53 -0000
@@ -299,7 +299,7 @@ in the following sections.
-fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol
-ftrapv -funroll-all-loops -funroll-loops @gol
-fdisable-simple -funroll-all-loops -funroll-loops @gol
--ftree-pre -ftree-ccp -ftree-dce @gol
+-ftree-pre -ftree-ccp -ftree-dce -fdisable-tree-ssa @gol
--param @var{name}=@var{value}
-O -O0 -O1 -O2 -O3 -Os}
@@ -4037,6 +4037,10 @@ default.
Do not re-write trees into SIMPLE form. This switch also disables
tree-based optimizations. @emph{Note:} This option is only useful when
debugging the tree simplification pass in GCC.
+
+@item -fdisable-tree-ssa
+Do not apply SSA optimizations to the tree representation. @emph{Note:}
+This option is only useful when debugging the tree SSA optimizers in GCC.
@item -ftree-pre
Perform Partial Redundancy Elimination (PRE) on trees. @emph{Note:} This