This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, libgfortran] PR48767 Rounding Up followup patch


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]