This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Flag-controlled type conversions/promotions
- From: Zydrunas Gimbutas <zydrunas dot gimbutas at gmail dot com>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: Andreas Kloeckner <kloeckner at cims dot nyu dot edu>, gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Sun, 15 Jan 2012 13:39:23 -0500
- Subject: Re: [patch] Flag-controlled type conversions/promotions
- References: <871utgao55.fsf@ding.tiker.net> <20120113234312.GA51690@troutmask.apl.washington.edu>
Hi,
Everything seems to be ok in this patch, except for minor typos in
documentation: REAl -> REAL, alignement -> alignment.
It would also be nice to extend the type conversion facility to
include -fdefault-real-16, -fdefault-double-16, -fdefault-real-10,
-fdefault-double-10, and add conversions for logical types, to
complete the conversion table. These are not very commonly used
(except for -fdefault-real-16, -fdefault-double-16, which would
correspond to -r16 and -autodouble flags in some compilers), so we
should be fine at this time.
Thanks to everyone for making this work!
Zydrunas
On Fri, Jan 13, 2012 at 6:43 PM, Steve Kargl
<sgk@troutmask.apl.washington.edu> wrote:
> On Wed, Nov 09, 2011 at 06:09:58PM -0500, Andreas Kloeckner wrote:
>> Hi there,
>>
>> please find attached the patch and the Changelog entry for our work on
>> the fortran bug #48426.
>>
>> The attached patch implements the options
>>
>> -finteger-4-integer-8
>> -freal-4-real-8
>> -freal-4-real-10
>> -freal-4-real-16
>> -freal-8-real-4
>> -freal-8-real-10
>> -freal-8-real-16
>>
>> to implement a variety of automatic type promotions. (This is particularly
>> helpful if one wants to quickly check whether a certain code has a bug limiting
>> its precision away from full machine accuracy.)
>>
>
> I plan to commit the attached patch this weekend.
>
> 2011-11-09 ?Zydrunas Gimbutas ?<gimbutas@cims.nyu.edu>
> ? ? ? ? ? ?Andreas Kloeckner ?<kloeckner@cims.nyu.edu>
> ? ? ? ? ? ?Steven G. Kargl ?<kargl@gcc.gnu.org>
>
> ? ? ? ?PR fortran/48426
> ? ? ? ?* gfortran.h (gfc_option_t): Add members flag_*_kind to store kind.
> ? ? ? ?* lang.opt: Add options -freal-4-real-8, -freal-4-real-10,
> ? ? ? ?-freal-4-real-16, -freal-8-real-4, -freal-8-real-10, -freal-8-real-16
> ? ? ? ?and -finteger-4-integer-8. User-desired type conversion information.
> ? ? ? ?* decl.c (gfc_match_old_kind_spec,kind_expr): Type conversions
> ? ? ? ?in declaration parsing.
> ? ? ? ?* trans-types.c (gfc_init_kinds): User-specified type conversion
> ? ? ? ?checked for current backend.
> ? ? ? ?* primary.c (match_integer_constant,match_real_constant): Implement
> ? ? ? ?type conversion in constant parsing.
> ? ? ? ?* options.c (gfc_init_options,gfc_handle_option): Translate input
> ? ? ? ?options to flags in internal options data structure.
> ? ? ? ?* invoke.texi: Document new options. ?Re-order options in Options
> ? ? ? ?summary section.
>
> --
> Steve