diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-21 13:50:30 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-21 13:50:30 +0000 |
commit | b0464d7cbaef4239f9a240023309d48634f91a8e (patch) | |
tree | 2c88a7bf23506da56dbf279cd6b6354f7030423f /gcc/tree-chrec.c | |
parent | cb88692574ca59ec688fc3543578557dbfb7df23 (diff) | |
download | gcc-b0464d7cbaef4239f9a240023309d48634f91a8e.tar.gz |
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: svn+ssh://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) |