diff options
author | Marek Polacek <polacek@redhat.com> | 2016-04-20 09:32:45 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-04-20 09:32:45 +0000 |
commit | 2697b189020b174f822a756914af6a04c905b435 (patch) | |
tree | 3b40c48a012b1dabf014a48b312fe99ac30a3f9a /gcc/tree-if-conv.c | |
parent | d566e90a165b8d8aeb74765fc1d845047200cf45 (diff) | |
download | gcc-2697b189020b174f822a756914af6a04c905b435.zip gcc-2697b189020b174f822a756914af6a04c905b435.tar.gz gcc-2697b189020b174f822a756914af6a04c905b435.tar.bz2 |
re PR tree-optimization/70725 (Internal compiler error (ICE) on valid code)
PR tree-optimization/70725
* tree-if-conv.c (is_false_predicate): New function.
(predicate_mem_writes): Use it.
* gcc.dg/pr70725.c: New test.
From-SVN: r235250
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r-- | gcc/tree-if-conv.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 9e305c7..a9fbab9 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -262,6 +262,16 @@ ifc_temp_var (tree type, tree expr, gimple_stmt_iterator *gsi) return new_name; } +/* Return true when COND is a false predicate. */ + +static inline bool +is_false_predicate (tree cond) +{ + return (cond == NULL_TREE + || cond == boolean_false_node + || integer_zerop (cond)); +} + /* Return true when COND is a true predicate. */ static inline bool @@ -1988,7 +1998,7 @@ predicate_mem_writes (loop_p loop) gimple *stmt; int index; - if (is_true_predicate (cond)) + if (is_true_predicate (cond) || is_false_predicate (cond)) continue; swap = false; |