aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssanames.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2015-09-30 09:24:02 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2015-09-30 09:24:02 +0000
commit6ea2f74cf9dbee7a3e41d4c2bd3757a2ea303b8e (patch)
treed3500a983497c0bd0167a8f97529626c0c3a2ed2 /gcc/tree-ssanames.c
parentae15100c9197195f26541c199aa4f6c75d36eb13 (diff)
downloadgcc-6ea2f74cf9dbee7a3e41d4c2bd3757a2ea303b8e.zip
gcc-6ea2f74cf9dbee7a3e41d4c2bd3757a2ea303b8e.tar.gz
gcc-6ea2f74cf9dbee7a3e41d4c2bd3757a2ea303b8e.tar.bz2
re PR tree-optimization/67690 (wrong code with -O2 on x86_64/Linux)
PR tree-optimization/67690 * tree-ssa-ifcombine.c (pass_tree_ifcombine::execute): Call reset_flow_sensitive_info_in_bb. * tree-ssa-tail-merge.c (replace_block_by): Likewise. * tree-ssanames.c: Include "gimple-iterator.h". (reset_flow_sensitive_info_in_bb): New function. * tree-ssanames.h (reset_flow_sensitive_info_in_bb): Declare. * gcc.dg/torture/pr67690.c: New test. From-SVN: r228284
Diffstat (limited to 'gcc/tree-ssanames.c')
-rw-r--r--gcc/tree-ssanames.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c
index 4199290..7235dc3 100644
--- a/gcc/tree-ssanames.c
+++ b/gcc/tree-ssanames.c
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "backend.h"
#include "tree.h"
#include "gimple.h"
+#include "gimple-iterator.h"
#include "hard-reg-set.h"
#include "ssa.h"
#include "alias.h"
@@ -544,6 +545,29 @@ reset_flow_sensitive_info (tree name)
SSA_NAME_RANGE_INFO (name) = NULL;
}
+/* Clear all flow sensitive data from all statements and PHI definitions
+ in BB. */
+
+void
+reset_flow_sensitive_info_in_bb (basic_block bb)
+{
+ for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ gimple *stmt = gsi_stmt (gsi);
+ ssa_op_iter i;
+ tree op;
+ FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_DEF)
+ reset_flow_sensitive_info (op);
+ }
+
+ for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ tree phi_def = gimple_phi_result (gsi.phi ());
+ reset_flow_sensitive_info (phi_def);
+ }
+}
/* Release all the SSA_NAMEs created by STMT. */