diff options
author | gfunck <gfunck@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-24 16:10:39 +0000 |
---|---|---|
committer | gfunck <gfunck@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-24 16:10:39 +0000 |
commit | 96db391ab341b6769a7a256c96e069099555b301 (patch) | |
tree | b5d29ca1fc2d8d2205e2a2b11d67cfd1619e5c4a /gcc/fold-const.c | |
parent | 91d14856f0d68c5bac7e6e8af9ac44caf6cdf793 (diff) | |
download | gcc-96db391ab341b6769a7a256c96e069099555b301.tar.gz |
2015-07-24 Gary Funck <gary@intrepid.com>
PR middle-end/66984
* fold-const.c (fold_binary_loc): Call fold_convert on arguments to
fold_build2 for CEIL_DIV_EXPR and FLOOR_DIV_EXPR optimization.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226168 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 739a3a98e29..e69b1d04133 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10746,7 +10746,9 @@ fold_binary_loc (location_t loc, after the last round to changes to the DIV code in expmed.c. */ if ((code == CEIL_DIV_EXPR || code == FLOOR_DIV_EXPR) && multiple_of_p (type, arg0, arg1)) - return fold_build2_loc (loc, EXACT_DIV_EXPR, type, arg0, arg1); + return fold_build2_loc (loc, EXACT_DIV_EXPR, type, + fold_convert (type, arg0), + fold_convert (type, arg1)); strict_overflow_p = false; if (TREE_CODE (arg1) == INTEGER_CST |