This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Followup fix for PR 21356 and PR 22332
- From: Diego Novillo <dnovillo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 9 Jul 2005 12:53:55 -0400
- Subject: Followup fix for PR 21356 and PR 22332
This is another of those cases where you wonder how did we get
away with this for such a long time. In execute_todo, we used to
call update_ssa *before* cleanup_tree_cfg.
So, update_ssa would merrily go on to compute dominance
information, dominance frontiers, do dominator tree traversals,
etc, with a messed up CFG.
Bootstrap and testing still in progress. This should also fix,
PR 22332. Could some Ada folk confirm please?
Diego.
PR 21356
PR 22332
* passes.c (execute_todo): Cleanup the CFG before updating
SSA.
Index: passes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.98
diff -d -u -p -r2.98 passes.c
--- passes.c 8 Jul 2005 23:36:41 -0000 2.98
+++ passes.c 9 Jul 2005 16:42:56 -0000
@@ -666,12 +662,7 @@ execute_todo (struct tree_opt_pass *pass
gcc_assert (flags & TODO_update_ssa_any);
#endif
- if (flags & TODO_update_ssa_any)
- {
- unsigned update_flags = flags & TODO_update_ssa_any;
- update_ssa (update_flags);
- }
-
+ /* Always cleanup the CFG before doing anything else. */
if (flags & TODO_cleanup_cfg)
{
if (current_loops)
@@ -680,6 +671,12 @@ execute_todo (struct tree_opt_pass *pass
cleanup_tree_cfg ();
}
+ if (flags & TODO_update_ssa_any)
+ {
+ unsigned update_flags = flags & TODO_update_ssa_any;
+ update_ssa (update_flags);
+ }
+
if ((flags & TODO_dump_func)
&& dump_file && current_function_decl)
{