aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-12-02 15:43:01 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-12-02 15:43:01 +0000
commit100f09a564fb1abe4c8d4712048c473c1fbaf248 (patch)
tree9fc08085cca4b298627c57cd8470d98d9df55b04 /gcc/tree-ssa-loop-niter.c
parent75fcf2876f2e3746137e939deec4cf2cff602d02 (diff)
downloadgcc-100f09a564fb1abe4c8d4712048c473c1fbaf248.zip
gcc-100f09a564fb1abe4c8d4712048c473c1fbaf248.tar.gz
gcc-100f09a564fb1abe4c8d4712048c473c1fbaf248.tar.bz2
re PR tree-optimization/59139 (internal compiler error: in get_val_for, at tree-ssa-loop-niter.c:2267)
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. From-SVN: r205588
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 05c3fac..08c8541 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