diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-02-02 00:43:19 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-02-02 00:43:19 +0100 |
commit | d3c52658629a1d170df67278db4c56e4a2742283 (patch) | |
tree | b34fdba5de42b6c55a7fb0e29cafe34e997bdf78 /gcc/expmed.c | |
parent | 02c5a3bd59e93557d9910c769d1c98100d84d6da (diff) | |
download | gcc-d3c52658629a1d170df67278db4c56e4a2742283.zip gcc-d3c52658629a1d170df67278db4c56e4a2742283.tar.gz gcc-d3c52658629a1d170df67278db4c56e4a2742283.tar.bz2 |
re PR c/5304 (gcc-20011231 generates incorrect divmod code for chars)
PR c/5304:
* expmed.c (expand_mult_highpart): Use immed_double_const for wide_op1
unconditionally.
* gcc.c-torture/execute/20020201-1.c: New test.
From-SVN: r49416
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 53ff05b..a26ad09 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -2760,15 +2760,12 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp, max_cost) op1 = GEN_INT (trunc_int_for_mode (cnst1, mode)); - if (GET_MODE_BITSIZE (wider_mode) <= HOST_BITS_PER_INT) - wide_op1 = op1; - else - wide_op1 - = immed_double_const (cnst1, - (unsignedp - ? (HOST_WIDE_INT) 0 - : -(cnst1 >> (HOST_BITS_PER_WIDE_INT - 1))), - wider_mode); + wide_op1 + = immed_double_const (cnst1, + (unsignedp + ? (HOST_WIDE_INT) 0 + : -(cnst1 >> (HOST_BITS_PER_WIDE_INT - 1))), + wider_mode); /* expand_mult handles constant multiplication of word_mode or narrower. It does a poor job for large modes. */ |