diff options
author | Gary Funck <gary@intrepid.com> | 2015-07-24 16:10:39 +0000 |
---|---|---|
committer | Gary Funck <gfunck@gcc.gnu.org> | 2015-07-24 16:10:39 +0000 |
commit | 64447a2d5091ba15fbb1d7ce403533217e97163e (patch) | |
tree | b5d29ca1fc2d8d2205e2a2b11d67cfd1619e5c4a /gcc | |
parent | a5a57bf378674be59968b4929f9647a72a3181c8 (diff) | |
download | gcc-64447a2d5091ba15fbb1d7ce403533217e97163e.zip gcc-64447a2d5091ba15fbb1d7ce403533217e97163e.tar.gz gcc-64447a2d5091ba15fbb1d7ce403533217e97163e.tar.bz2 |
re PR middle-end/66984 (ICE: fold_binary changes type of operand, causing failure in verify_gimple_assign_binary)
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.
From-SVN: r226168
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fold-const.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 59910bf..fc7bd76 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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. + 2015-07-24 Tom de Vries <tom@codesourcery.com> * tree-parloops.c (gen_parallel_loop): Add debug print for alternative diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 739a3a9..e69b1d0 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 |