From: Tom de Vries Date: Tue, 17 Nov 2015 21:42:18 +0000 (+0000) Subject: Clear LOOP_CLOSED_SSA after pass_ccp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=635d5dd516a2d4512a2d90dade2f1d7b54632907;p=gcc.git Clear LOOP_CLOSED_SSA after pass_ccp 2015-11-17 Tom de Vries * tree-ssa-ccp.c (do_ssa_ccp): Clear LOOP_CLOSED_SSA in loops state if something changed. From-SVN: r230503 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b208b470c0b..a21f18bbb82 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-11-17 Tom de Vries + + * tree-ssa-ccp.c (do_ssa_ccp): Clear LOOP_CLOSED_SSA in loops state if + something changed. + 2015-11-17 Tom de Vries * cfgloop.h (struct loop): Add in_oacc_kernels_region field. diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 7b6b4518b08..7e8bc5276e9 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -139,6 +139,7 @@ along with GCC; see the file COPYING3. If not see #include "params.h" #include "builtins.h" #include "tree-chkp.h" +#include "cfgloop.h" /* Possible lattice values. */ @@ -2402,10 +2403,17 @@ do_ssa_ccp (bool nonzero_p) { unsigned int todo = 0; calculate_dominance_info (CDI_DOMINATORS); + ccp_initialize (); ssa_propagate (ccp_visit_stmt, ccp_visit_phi_node); if (ccp_finalize (nonzero_p)) - todo = (TODO_cleanup_cfg | TODO_update_ssa); + { + todo = (TODO_cleanup_cfg | TODO_update_ssa); + + /* ccp_finalize does not preserve loop-closed ssa. */ + loops_state_clear (LOOP_CLOSED_SSA); + } + free_dominance_info (CDI_DOMINATORS); return todo; }