This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, libgfortran] PR48767 Rounding Up followup patch
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Jerry DeLisle <jvdelisle at frontier dot com>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 1 May 2011 12:30:21 +0300
- Subject: Re: [patch, libgfortran] PR48767 Rounding Up followup patch
- References: <4DBB6707.1050703@frontier.com> <BANLkTikndEfeH5fj4n+9ivvTNzCntcfw7g@mail.gmail.com> <4DBC108C.8030601@frontier.com>
On Sat, Apr 30, 2011 at 16:37, Jerry DeLisle <jvdelisle@frontier.com> wrote:
> On 04/30/2011 12:56 AM, Janne Blomqvist wrote:
>>
>> On Sat, Apr 30, 2011 at 04:33, Jerry DeLisle<jvdelisle@frontier.com>
>> Âwrote:
>>>
>>> Hi,
>>>
>>> The attached patch does some cleanup and a check for trailing zeros to
>>> decide whether or not to round.
>>>
>>> I have added the additional test cases posted on the bugzilla to the
>>> existing test case round_3.f08.
>>>
>>> Regression tested on x86-64.
>>>
>>> OK for trunk and then I will back port the whole enchilada to 4.6.1 in a
>>> few
>>> weeks. ÂPlease consider the starting point of the zero scan carefully. ÂI
>>> have not convinced myself that the d * p covers all cases, but it works
>>> for
>>> all cases I have tried.
>>
>> I'm a bit suspicious about that as well:
>>
>> + Â Â Â /* Scan for trailing zeros to see if we really need to round it.
>> Â*/
>> + Â Â Â for(i = 1 + Âd * p ; i< Ândigits; i++)
>> + Â Â Â Â {
>> + Â Â Â Â Â if (digits[i] != '0')
>> + Â Â Â Â Â Â goto do_rnd;
>> + Â Â Â Â }
>> + Â Â Â goto skip;
>>
>
> I must have been tired yesterday. ÂRevised chunk. ÂRegression tests OK.
>
> @@ -233,7 +231,13 @@
> Â Â Â Âif (sign_bit)
> Â Â Â Â Âgoto skip;
> Â Â Â Ârchar = '0';
> - Â Â Â break;
> + Â Â Â /* Scan for trailing zeros to see if we really need to round it. Â*/
> + Â Â Â for(i = nbefore + nafter; i < ndigits; i++)
> + Â Â Â Â {
> + Â Â Â Â Â if (digits[i] != '0')
> + Â Â Â Â Â Â goto do_rnd;
> + Â Â Â Â }
> + Â Â Â goto skip;
> Â Â Â case ROUND_DOWN:
> Â Â Â Âif (!sign_bit)
> Â Â Â Â Âgoto skip;
>
> OK for trunk?
Ok.
--
Janne Blomqvist