This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix real_2expN mode arguments in fixed-value.c
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 29 Oct 2015 16:03:00 +0000
- Subject: Re: Fix real_2expN mode arguments in fixed-value.c
- Authentication-results: sourceware.org; auth=none
- References: <87io5pu22i dot fsf at e105548-lin dot cambridge dot arm dot com> <56323E19 dot 3020109 at redhat dot com>
Bernd Schmidt <bschmidt@redhat.com> writes:
> On 10/29/2015 04:28 PM, Richard Sandiford wrote:
>> * fixed-value.c (check_real_for_fixed_mode, fixed_from_string)
>> (fixed_to_decimal, fixed_convert_from_real)
>> (real_convert_from_fixed): Fix mode arguments to real_2expN.
>
> Passing VOIDmode rather than the real mode is a bit of a strange fix.
> Why can't the called function deal with the proper mode? (real_2expN
> also doesn't document the mode argument which should be fixed).
VOIDmode is the usual real.[hc] way of getting maximum precision,
which I think is the natural choice for these temporary real_values.
The mode only becomes significant when you want to round the result.
Thanks,
Richard