From: Marek Polacek Date: Mon, 23 Nov 2015 17:18:36 +0000 (+0000) Subject: re PR tree-optimization/68455 (ICE: tree check: expected integer_cst, have plus_expr... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=78275c8bdbcd4b9250ce82ef033c8851cdda3fba;p=gcc.git re PR tree-optimization/68455 (ICE: tree check: expected integer_cst, have plus_expr in decompose, at tree.h:5123) PR tree-optimization/68455 * tree-vrp.c (extract_range_from_binary_expr_1): Don't call extract_range_from_multiplicative_op_1 on symbolic ranges. * gcc.dg/tree-ssa/pr68455.c: New test. From-SVN: r230768 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cd57e0c27a7..0bcfc9ebf05 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-11-23 Marek Polacek + + PR tree-optimization/68455 + * tree-vrp.c (extract_range_from_binary_expr_1): Don't call + extract_range_from_multiplicative_op_1 on symbolic ranges. + 2015-11-23 Richard Henderson * optabs.def (uaddv4_optab, usubv4_optab): New. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dd7f96a8faa..d65527fbdad 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-23 Marek Polacek + + PR tree-optimization/68455 + * gcc.dg/tree-ssa/pr68455.c: New test. + 2015-11-23 Richard Biener PR tree-optimization/68465 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr68455.c b/gcc/testsuite/gcc.dg/tree-ssa/pr68455.c new file mode 100644 index 00000000000..6b46b3066db --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr68455.c @@ -0,0 +1,19 @@ +/* PR tree-optimization/68455 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int r; +int n; + +void +fn1 (void) +{ + int i; + + for (i = 0; i < 1; ++i) + { + unsigned short int u; + if (u < n) + r = 1 / n; + } +} diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 70011908acb..acbb70bbbfd 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -3015,7 +3015,7 @@ extract_range_from_binary_expr_1 (value_range *vr, return; } } - else + else if (!symbolic_range_p (&vr0) && !symbolic_range_p (&vr1)) { extract_range_from_multiplicative_op_1 (vr, code, &vr0, &vr1); return;