diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-12-02 15:43:01 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-12-02 15:43:01 +0000 |
commit | ec1d1b756679aff8d74b720f3d7a69d734279c45 (patch) | |
tree | 9fc08085cca4b298627c57cd8470d98d9df55b04 /gcc/tree-ssa-loop-niter.c | |
parent | 1ce9082218a1cc3a19963f5a3ceeb5c82eeb1c3f (diff) | |
download | ppe42-gcc-ec1d1b756679aff8d74b720f3d7a69d734279c45.tar.gz ppe42-gcc-ec1d1b756679aff8d74b720f3d7a69d734279c45.zip |
2013-12-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/59139
* tree-ssa-loop-niter.c (chain_of_csts_start): Properly match
code in get_val_for.
(get_val_for): Use gcc_checking_asserts.
* gcc.dg/torture/pr59139.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205588 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 05c3facd0e8..08c8541b490 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -2167,7 +2167,8 @@ chain_of_csts_start (struct loop *loop, tree x) return NULL; } - if (gimple_code (stmt) != GIMPLE_ASSIGN) + if (gimple_code (stmt) != GIMPLE_ASSIGN + || gimple_assign_rhs_class (stmt) == GIMPLE_TERNARY_RHS) return NULL; code = gimple_assign_rhs_code (stmt); @@ -2235,7 +2236,7 @@ get_val_for (tree x, tree base) { gimple stmt; - gcc_assert (is_gimple_min_invariant (base)); + gcc_checking_assert (is_gimple_min_invariant (base)); if (!x) return base; @@ -2244,7 +2245,7 @@ get_val_for (tree x, tree base) if (gimple_code (stmt) == GIMPLE_PHI) return base; - gcc_assert (is_gimple_assign (stmt)); + gcc_checking_assert (is_gimple_assign (stmt)); /* STMT must be either an assignment of a single SSA name or an expression involving an SSA name and a constant. Try to fold that |