aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-26 11:12:20 (GMT)
committerThan McIntosh <thanm@google.com>2015-12-16 20:08:13 (GMT)
commit1c9f0db349a553014d418dcda594b09e386b9b0c (patch)
tree95792fa1f4c558381f5f371dca7acc4c57f930e6
parentf8e25f42573503b96db7074cf16ee52064a6da35 (diff)
downloadtoolchain_gcc-1c9f0db349a553014d418dcda594b09e386b9b0c.zip
toolchain_gcc-1c9f0db349a553014d418dcda594b09e386b9b0c.tar.gz
toolchain_gcc-1c9f0db349a553014d418dcda594b09e386b9b0c.tar.bz2
Cherrypick PR bootstrap/66638 bugfix from trunk.
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 Bug: 26224556 Change-Id: I2fa31bfe44978659a554a413c64d796b357338b5 Signed-off-by: Than McIntosh <thanm@google.com>
-rw-r--r--gcc-4.9/gcc/tree-ssa-loop-niter.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc-4.9/gcc/tree-ssa-loop-niter.c b/gcc-4.9/gcc/tree-ssa-loop-niter.c
index cb9214f..db069e0 100644
--- a/gcc-4.9/gcc/tree-ssa-loop-niter.c
+++ b/gcc-4.9/gcc/tree-ssa-loop-niter.c
@@ -3950,7 +3950,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;