diff options
author | Richard Guenther <rguenther@suse.de> | 2008-08-21 13:50:30 +0000 |
---|---|---|
committer | Richard Guenther <rguenther@suse.de> | 2008-08-21 13:50:30 +0000 |
commit | 6eb9e5a25adda204851f86b80e7bfa5a0ae55ee1 (patch) | |
tree | 2c88a7bf23506da56dbf279cd6b6354f7030423f /gcc/tree-chrec.c | |
parent | ed65542045d8144078db53c3bfd55c0e8f804b35 (diff) |
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.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@139385 138bc75d-0d04-0410-961f-82ee72b054a4
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 89e96fd53b6..da359529e4c 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) |