[PATCH, Fortran] Allow CHARACTER literals in assignments and DATA statements
Tobias Burnus
tobias@codesourcery.com
Fri Nov 8 10:17:00 GMT 2019
On 11/8/19 10:45 AM, Mark Eggleston wrote:
> PING - OK, to commit? I have a pending patch that needs this in place.
Thanks for the ping. â Any chance, that you also work on some of the
general issues once in a while (cf. Bugzilla remark below); e.g. one bug
per week or fortnight? (Can be a simple one, just not to keep the number
of bugs growing.)
@Anyone â side question: Are there other pending patches? Ignoring one
OpenMP and several OpenACC patches, I am currently aware of:
* [Needs review] José's PR92142 - CFI_setpointer corrupts descriptor
patch [FSF copyright assignment exists]
* [Nearly ready, but needs fixes/follow-up patch] Steve's PR91178 for
code like 'call foo(a, (a))'
* [Approved but not committed] Paul's PR92123 patch for bind(C) + alloc
scalars.
Side remark: On the bind(C) side, I think PR 92189 should be fixed.
Additionally, there are several recent reports on segfaults and
regressions, looking Bugzilla (component = fortran, sort by change data).
Back to this pending patch:
On 11/5/19 10:55 AM, Mark Eggleston wrote:
> I noticed that warning were not produced for conversion to logicals,
> re-ordering of an if..else if sequence fixes that problem. Additional
> test cases have been added.
Looks as if reviewing and revisiting the patch was worthwhile :-) Thanks!
> Please find attached the updated patch, the change logs follow. OK to
> commit?
LGTM. Thanks for patch.
Cheers,
Tobias
PS: I still find it interesting, which Fortran code gets used; from a
supercomputing centre, I heard that everything between
afterwards-never-touched FORTRAN IV code to code using the latest
Fortran features is used. (But most amazing I find code, which gets
newly written in a FORTRAN 66 style/features with some sparse F20xx
features in between â like the "publicx" example of recently [instead of
'public x' or 'public::x'; spaces aren't that expensive anymore].)
> gcc/fortran/ChangeLog
>
>    Jim MacArthur <jim.macarthur@codethink.co.uk>
>    Mark Eggleston <mark.eggleston@codethink.com>
>
> Â Â Â * arith.c (hollerith2representation): Use
> OPT_Wcharacter_truncation in
>    call to gfc_warning. Add character2representation,
> gfc_character2int,
> Â Â Â gfc_character2real, gfc_character2complex and gfc_character2logical.
> Â Â Â * arith.h: Add prototypes for gfc_character2int, gfc_character2real,
> Â Â Â gfc_character2complex and gfc_character2logical.
> Â Â Â * expr.c (gfc_check_assign): Return true if left hand side is numeric
> Â Â Â or logical and the right hand side is character and of kind=1.
> Â Â Â * gfortran.texi: Add -fdec-char-conversions.
> Â Â Â * intrinsic.c (add_conversions): Add conversions from character to
> Â Â Â integer, real, complex and logical types for their supported kinds.
> Â Â Â (gfc_convert_type_warn): Reorder if..else if.. sequence so that
> warnings
> Â Â Â are produced for conversion to logical.
> Â Â Â * invoke.texi: Add option to list of options.
> Â Â Â * invoke.texi: Add Character conversion subsection to Extensions
> Â Â Â section.
> Â Â Â * lang.opt: Add new option.
> Â Â Â * options.c (set_dec_flags): Add SET_BITFLAG for
> Â Â Â flag_dec_char_conversions.
> Â Â Â * resolve.c (resolve_ordindary_assign): Issue error if the left hand
> Â Â Â side is numeric or logical and the right hand side is a character
> Â Â Â variable.
> Â Â Â * simplify.c (gfc_convert_constant): Assign the conversion function
> Â Â Â depending on destination type.
> Â Â Â * trans-const.c (gfc_constant_to_tree): Use OPT_Wsurprising in
> Â Â Â gfc_warning allowing the warning to be switched off only if
> Â Â Â flag_dec_char_conversions is enabled.
>
> gcc/testsuite/gfortran.dg
>
> Â Â Â Jim MacArthur <jim.macarthur@codethink.co.uk>
> Â Â Â Mark Eggleston <mark.eggleston@codethink.com>
>
> Â Â Â PR fortran/89103
> Â Â Â * gfortran.dg/dec_char_conversion_in_assignment_1.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_assignment_2.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_assignment_3.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_assignment_4.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_assignment_5.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_assignment_6.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_assignment_7.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_assignment_8.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_data_1.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_data_2.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_data_3.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_data_4.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_data_5.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_data_6.f90: New test.
> Â Â Â * gfortran.dg/dec_char_conversion_in_data_7.f90: New test.
> Â Â Â * gfortran.dg/hollerith5.f90: Add -Wsurprising to options.
> Â Â Â * gfortran.dg/hollerith_legacy.f90: Add -Wsurprising to options.
> Â Â Â * gfortran.dg/no_char_to_numeric_assign.f90: New test.
More information about the Gcc-patches
mailing list