[Patch, Fortran] dec comparisons - for review

Mark Eggleston mark.eggleston@codethink.co.uk
Fri Nov 15 10:53:00 GMT 2019


This patch allows comparison of numeric values with Holleriths. This 
feature is not guarded by a compiler option as it is preferred that 
extra options should avoided, this seems reasonable as current Hollerith 
support does not have such an option.

In addition it also allows comparison of character values with 
Holleriths, this is guarded by a compiler option, I've used the existing 
-fdec-char-conversions because the Hollerith is converted to character 
for the comparison to be made.

These legacy features are supported by xlf, Sun and flang compilers.

I know the deadline for new features is close. Does the process have to 
completed before the deadline or can it overlap? If not I'll withdraw it 
until stage 1 is re-opened.

While preparing the patch I noticed that the test cases need to re-use 
duplicate code via the include mechanism. I'll work on fixing that while 
this patch is being reviewed.

ChangeLogs

gcc/fortran

     Jim MacArthur  <jim.macarthur@codethink.co.uk>
     Mark Eggleston  <mark.eggleston@codethink.com>

     * gfortran.texi: Update Hollerith constants support for character types
     and use in comparisons.
     * invoke.texi: Tidy up list of options. Update description of
     -fdec-char-conversions for character to hollerith comparisons.
     * lang.opt: -fdec-char-conversions also allows comparison of characters
     with Hollerith constants.
     * resolve.c (is_character_based): New.
     (Convert_hollerith_to_character): New. (convert_to_numeric): New.
     (resolve_operator): If both sides are character based convert Hollerith
     to character. If an operand is Hollerith and the other is numeric
     convert to numeric.  (resolve_ordinary_assign): Add check for
     -fdec-char-conversions for assignment of character literals.

gcc/testsuite

     Jim MacArthur <jim.macarthur@codethink.co.uk>
     Mark Eggleston <mark.eggleston@codethink.com>

     * gfortran.dg/dec-comparison-character_1.f90: New test.
     * gfortran.dg/dec-comparison-character_2.f90: New test.
     * gfortran.dg/dec-comparison-character_3.f90: New test.
     * gfortran.dg/dec-comparison-complex_1.f90: New test.
     * gfortran.dg/dec-comparison-complex_2.f90: New test.
     * gfortran.dg/dec-comparison-complex_3.f90: New test.
     * gfortran.dg/dec-comparison-complex_4.f90: New test.
     * gfortran.dg/dec-comparison-int_1.f90: New test.
     * gfortran.dg/dec-comparison-int_2.f90: New test.
     * gfortran.dg/dec-comparison-int_3.f90: New test.
     * gfortran.dg/dec-comparison-int_4.f90: New test.
     * gfortran.dg/dec-comparison-real_1.f90: New test.
     * gfortran.dg/dec-comparison-real_2.f90: New test.
     * gfortran.dg/dec-comparison-real_3.f90: New test.
     * gfortran.dg/dec-comparison-real_4.f90: New test.
     * gfortran.dg/dec-comparison.f90: New test.


-- 
https://www.codethink.co.uk/privacy.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dec-comparisons.patch
Type: text/x-patch
Size: 30509 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191115/ee461866/attachment.bin>


More information about the Gcc-patches mailing list