public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, fortran] ISO_Fortran_binding PRs 90093, 90352 & 90355
@ 2019-05-06 18:57 Paul Richard Thomas
  2019-05-06 18:59 ` Paul Richard Thomas
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Richard Thomas @ 2019-05-06 18:57 UTC (permalink / raw)
  To: fortran, gcc-patches

Unfortunately, this patch was still in the making at the release of
9.1. It is more or less self explanatory with the ChangeLogs.

It should be noted that gfc_conv_expr_present could not be used in the
fix for PR90093 because the passed descriptor is a CFI type. Instead,
the test is for a null pointer passed.

The changes to trans-array.c(gfc_trans_create_temp_array) have an eye
on the future, as well as PR90355. I am progressing towards the point
where all descriptors have 'span' set correctly so that
trans.c(get_array_span) can be eliminated and much of the code in the
callers can be simplified.

Bootstrapped and regtested on FC29/x86_64 - OK for trunk and 9-branch?

Paul

2019-05-06  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/90093
    * trans-decl.c (convert_CFI_desc): Test that the dummy is
    present before doing any of the conversions.

    PR fortran/90352
    * decl.c (gfc_verify_c_interop_param): Restore the error for
    charlen > 1 actual arguments passed to bind(C) procs.
    Clean up trailing white space.

    PR fortran/90355
    * trans-array.c (gfc_trans_create_temp_array): Set the 'span'
    field to the element length for all types.
    (gfc_conv_expr_descriptor): The force_no_tmp flag is used to
    prevent temporary creation, especially for substrings.
    * trans-decl.c (gfc_trans_deferred_vars): Rather than assert
    that the backend decl for the string length is non-null, use it
    as a condition before calling gfc_trans_vla_type_sizes.
    * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): 'force_no_tmp'
    is set before calling gfc_conv_expr_descriptor.
    * trans.c (get_array_span): Move the code for extracting 'span'
    from gfc_build_array_ref to this function. This is specific to
    descriptors that are component and indirect references.
    * trans.h : Add the force_no_tmp flag bitfield to gfc_se.

2019-05-06  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/90093
    * gfortran.dg/ISO_Fortran_binding_12.f90: New test.
    * gfortran.dg/ISO_Fortran_binding_12.c: Supplementary code.

    PR fortran/90352
    * gfortran.dg/iso_c_binding_char_1.f90: New test.

    PR fortran/90355
    * gfortran.dg/ISO_Fortran_binding_4.f90: Add 'substr' to test
    the direct passing of substrings as descriptors to bind(C).
    * gfortran.dg/assign_10.f90: Increase the tree_dump count of
    'atmp' to account for the setting of the 'span' field.
    * gfortran.dg/transpose_optimization_2.f90: Ditto.

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [Patch, fortran] ISO_Fortran_binding PRs 90093, 90352 & 90355
@ 2019-05-07  8:39 Dominique d'Humières
  2019-05-07 18:47 ` Paul Richard Thomas
  0 siblings, 1 reply; 7+ messages in thread
From: Dominique d'Humières @ 2019-05-07  8:39 UTC (permalink / raw)
  To: Paul Richard Thomas; +Cc: gfortran, gcc-patches

Hi Paul,

With your patch, I see

FAIL: gfortran.dg/iso_c_binding_char_1.f90   -O   (test for errors, line 8)
FAIL: gfortran.dg/iso_c_binding_char_1.f90   -O   (test for errors, line 9)
FAIL: gfortran.dg/iso_c_binding_char_1.f90   -O  (test for excess errors)

This is due to a bad location of the errors:

/opt/gcc/work/gcc/testsuite/gfortran.dg/iso_c_binding_char_1.f90:7:16:

    7 | subroutine bar(c,d) BIND(C)
      |                1
Error: Character argument 'c' at (1) must be length 1 because procedure 'bar' is BIND(C)
/opt/gcc/work/gcc/testsuite/gfortran.dg/iso_c_binding_char_1.f90:7:18:

    7 | subroutine bar(c,d) BIND(C)
      |                  1
Error: Character argument 'd' at (1) must be length 1 because procedure 'bar' is BIND(C)

TIA

Dominique

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-11  7:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-06 18:57 [Patch, fortran] ISO_Fortran_binding PRs 90093, 90352 & 90355 Paul Richard Thomas
2019-05-06 18:59 ` Paul Richard Thomas
2019-05-08 18:41   ` Paul Richard Thomas
2019-05-10  8:01     ` Paul Richard Thomas
2019-05-11  7:54       ` Paul Richard Thomas
2019-05-07  8:39 Dominique d'Humières
2019-05-07 18:47 ` Paul Richard Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).