diff options
author | amker <amker@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-26 11:12:20 +0000 |
---|---|---|
committer | amker <amker@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-26 11:12:20 +0000 |
commit | 7cf4130d6ede1658935066522bfb4a3fb232907e (patch) | |
tree | 85126074539f49aa76d0d55c27a49412608d7f2e /gcc/tree-ssa-loop-niter.c | |
parent | 69693ea7b7ed45a12cbd505b2a66257fd4e81669 (diff) | |
download | gcc-7cf4130d6ede1658935066522bfb4a3fb232907e.tar.gz |
PR bootstrap/66638
* tree-ssa-loop-niter.c (loop_exits_before_overflow): Skip if
assertion failed. Remove assertion itself.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225008 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 855d32ceeb0..c5adb1c2d82 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -3955,7 +3955,21 @@ loop_exits_before_overflow (tree base, tree step, if (!CONVERT_EXPR_P (e) || !operand_equal_p (e, unsigned_base, 0)) continue; e = TREE_OPERAND (e, 0); - gcc_assert (operand_equal_p (e, base, 0)); + /* It may still be possible to prove no overflow even if condition + "operand_equal_p (e, base, 0)" isn't satisfied here, like below + example: + + e : ssa_var ; unsigned long type + base : (int) ssa_var + unsigned_base : (unsigned int) ssa_var + + Unfortunately this is a rare case observed during GCC profiled + bootstrap. See PR66638 for more information. + + For now, we just skip the possibility. */ + if (!operand_equal_p (e, base, 0)) + continue; + if (tree_int_cst_sign_bit (step)) { code = LT_EXPR; |