diff options
author | Richard Guenther <rguenther@suse.de> | 2008-08-21 13:50:30 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-08-21 13:50:30 +0000 |
commit | 729edaa1bb60f7bffea3ed7e701373d6f37af8b0 (patch) | |
tree | 2c88a7bf23506da56dbf279cd6b6354f7030423f /gcc/tree-chrec.c | |
parent | 812dbce5c7f49c637ceb72229a6341ba97989ca9 (diff) | |
download | gcc-729edaa1bb60f7bffea3ed7e701373d6f37af8b0.zip gcc-729edaa1bb60f7bffea3ed7e701373d6f37af8b0.tar.gz gcc-729edaa1bb60f7bffea3ed7e701373d6f37af8b0.tar.bz2 |
re PR middle-end/36817 (internal compiler error: in compare_values_warnv)
2008-08-21 Richard Guenther <rguenther@suse.de>
PR middle-end/36817
* tree-chrec.c (chrec_apply): Always call chrec_fold_plus which
makes sure to produce a result of the correct type.
* gcc.c-torture/compile/pr36817.c: New testcase.
From-SVN: r139385
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r-- | gcc/tree-chrec.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index 89e96fd..da35952 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -579,8 +579,7 @@ chrec_apply (unsigned var, /* "{a, +, b} (x)" -> "a + b*x". */ x = chrec_convert_rhs (type, x, NULL); res = chrec_fold_multiply (TREE_TYPE (x), CHREC_RIGHT (chrec), x); - if (!integer_zerop (CHREC_LEFT (chrec))) - res = chrec_fold_plus (type, CHREC_LEFT (chrec), res); + res = chrec_fold_plus (type, CHREC_LEFT (chrec), res); } else if (TREE_CODE (chrec) != POLYNOMIAL_CHREC) |