This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] invoke some cleanups at -O0
- From: Richard Henderson <rth at twiddle dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 Sep 2003 14:15:28 -0700
- Subject: [tree-ssa] invoke some cleanups at -O0
I think that long term we need for there to be exactly one way that
exceptions are handled. Eventually we'll remove the -fno-gimple
option and that'll be able to happen.
In the near term this fixes a failure in g++.dg/eh/cleanup1.C that
happens on Alpha that did not happen on x86. We blow the stack in
expand_expr handling the 8000 nested try_finally_exprs. We still
timeout in this test, but I consider that better than an ICE.
r~
* tree-optimize.c (optimize_function_tree): Move calls to
remove_useless_stmts_and_vars and lower_eh_constructs ...
(tree_rest_of_compilation): ... here.
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 1.1.4.52
diff -c -p -d -r1.1.4.52 tree-optimize.c
*** tree-optimize.c 28 Sep 2003 06:06:37 -0000 1.1.4.52
--- tree-optimize.c 30 Sep 2003 20:49:19 -0000
*************** optimize_function_tree (tree fndecl)
*** 61,83 ****
/* Build the flowgraph. */
init_flow ();
- /* Run a pass over the statements deleting any obviously useless
- statements before we build the CFG. */
- remove_useless_stmts_and_vars (&DECL_SAVED_TREE (fndecl), false);
- {
- int flags;
- FILE *file = dump_begin (TDI_useless, &flags);
- if (file)
- {
- dump_function_to_file (fndecl, file, flags);
- dump_end (TDI_useless, file);
- }
- }
-
- /* Run a pass to lower magic exception handling constructs into,
- well, less magic though not completely mundane constructs. */
- lower_eh_constructs (&DECL_SAVED_TREE (fndecl));
-
build_tree_cfg (DECL_SAVED_TREE (fndecl));
/* Begin analysis and optimization passes. After the function is
--- 61,66 ----
*************** tree_rest_of_compilation (tree fndecl, b
*** 299,304 ****
--- 282,304 ----
/* Debugging dump after gimplification. */
dump_function (TDI_gimple, fndecl);
+ /* Run a pass over the statements deleting any obviously useless
+ statements before we build the CFG. */
+ remove_useless_stmts_and_vars (&DECL_SAVED_TREE (fndecl), false);
+ {
+ int flags;
+ FILE *file = dump_begin (TDI_useless, &flags);
+ if (file)
+ {
+ dump_function_to_file (fndecl, file, flags);
+ dump_end (TDI_useless, file);
+ }
+ }
+
+ /* Run a pass to lower magic exception handling constructs into,
+ well, less magic though not completely mundane constructs. */
+ lower_eh_constructs (&DECL_SAVED_TREE (fndecl));
+
/* Invoke the SSA tree optimizer. */
if (optimize >= 1 && !flag_disable_tree_ssa)
optimize_function_tree (fndecl);