diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-01-08 21:50:24 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-01-08 21:50:24 +0100 |
commit | e0237993b6bce554cc36c00a258f99f486a46d63 (patch) | |
tree | 8f6d20e0c56e248d7ed7ef5ea26783237812248f /gcc/gimple-fold.c | |
parent | bd8f5bb2978922bf0cf51eef3486f4da83df556d (diff) | |
download | gcc-e0237993b6bce554cc36c00a258f99f486a46d63.zip gcc-e0237993b6bce554cc36c00a258f99f486a46d63.tar.gz gcc-e0237993b6bce554cc36c00a258f99f486a46d63.tar.bz2 |
re PR tree-optimization/69167 (internal compiler error: SSA corruption)
PR tree-optimization/69167
* gimple-fold.c (replace_stmt_with_simplification): Also punt if
new SSA_NAME_OCCURS_IN_ABNORMAL_PHI SSA_NAMEs appear in operands of
ops[0] comparison.
* gimple-match-head.c (maybe_push_res_to_seq): Likewise.
* gcc.dg/pr69167.c: New test.
From-SVN: r232178
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r-- | gcc/gimple-fold.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 2f379be..70871cf 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -3309,7 +3309,14 @@ replace_stmt_with_simplification (gimple_stmt_iterator *gsi, || (ops[2] && TREE_CODE (ops[2]) == SSA_NAME && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ops[2]) - && !has_use_on_stmt (ops[2], stmt))) + && !has_use_on_stmt (ops[2], stmt)) + || (COMPARISON_CLASS_P (ops[0]) + && ((TREE_CODE (TREE_OPERAND (ops[0], 0)) == SSA_NAME + && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (TREE_OPERAND (ops[0], 0)) + && !has_use_on_stmt (TREE_OPERAND (ops[0], 0), stmt)) + || (TREE_CODE (TREE_OPERAND (ops[0], 1)) == SSA_NAME + && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (TREE_OPERAND (ops[0], 1)) + && !has_use_on_stmt (TREE_OPERAND (ops[0], 1), stmt))))) return false; /* Don't insert new statements when INPLACE is true, even if we could |