From: Richard Biener Date: Wed, 13 Mar 2019 11:32:11 +0000 (+0000) Subject: re PR middle-end/89677 (internal compiler error: in wide_int_to_tree_1, at tree.c... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cd5091f1eab0b6f19a1f0557bf40d1aa9ec34dd4;p=gcc.git re PR middle-end/89677 (internal compiler error: in wide_int_to_tree_1, at tree.c:1549) 2019-03-13 Richard Biener PR middle-end/89677 * tree-scalar-evolution.c (simplify_peeled_chrec): Do not throw FP expressions at tree-affine. * gcc.dg/torture/pr89677.c: New testcase. From-SVN: r269646 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 73b62b2c917..86e210b4e27 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-03-13 Richard Biener + + PR middle-end/89677 + * tree-scalar-evolution.c (simplify_peeled_chrec): Do not + throw FP expressions at tree-affine. + 2019-03-14 Richard Biener * tree-pretty-print.c (dump_generic_node): For -gimple properly diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2439836d647..a61b668d2e1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-13 Richard Biener + + PR middle-end/89677 + * gcc.dg/torture/pr89677.c: New testcase. + 2019-03-13 Paolo Carlini PR c++/85558 diff --git a/gcc/testsuite/gcc.dg/torture/pr89677.c b/gcc/testsuite/gcc.dg/torture/pr89677.c new file mode 100644 index 00000000000..a45ca1f61a1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr89677.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target int32plus } */ + +int a, b, d; +unsigned c; +float e, f, g; +void h() { + float *i = &g; + for (; c < 10; c += 3) + for (; d; d += 3) { + a = *i; + g = f + 0; + f = b + *i + (b - e + 305219) + -b + 3; + } +} diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 3de559047da..c814437c239 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -1456,6 +1456,11 @@ simplify_peeled_chrec (struct loop *loop, tree arg, tree init_cond) return build_polynomial_chrec (loop->num, init_cond, right); } + /* The affine code only deals with pointer and integer types. */ + if (!POINTER_TYPE_P (type) + && !INTEGRAL_TYPE_P (type)) + return chrec_dont_know; + /* Try harder to check if they are equal. */ tree_to_aff_combination_expand (left, type, &aff1, &peeled_chrec_map); tree_to_aff_combination_expand (step_val, type, &aff2, &peeled_chrec_map);