https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40196

--- Comment #11 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Thu Nov  1 19:36:08 2018
New Revision: 265729

URL: https://gcc.gnu.org/viewcvs?rev=265729&root=gcc&view=rev
Log:
2018-11-01  Paul Thomas  <pa...@gcc.gnu.org>

        PR fortran/40196
        * dependency.c (are_identical_variables): Return false if the
        inquiry refs are not the same.
        (gfc_ref_needs_temporary_p): Break on an inquiry ref.
        * dump_parse_tree.c (show_ref): Show the inquiry ref type.
        * expr.c (gfc_free_ref_list): Break on an inquiry ref.
        (gfc_copy_ref): Copy the inquiry ref types.
        (find_inquiry_ref): New function.
        (simplify_const_ref, simplify_ref_chain): Call it. Add new arg
        to simplify_ref_chain.
        (gfc_simplify_expr): Use the new arg in call to
        simplify_ref_chain.
        (gfc_get_full_arrayspec_from_expr, gfc_is_coarray): Break on
        inquiry ref.
        (gfc_traverse_expr): Return true for inquiry ref.
        * frontend-passes.c (gfc_expr_walker): Break on inquiry ref.
        * gfortran.h : Add enums and union member in gfc_ref to
        implement inquiry refs.
        * intrinsic.c : Fix white nois.
        * match.c (gfc_match_assignment): A constant lavlue is an
        error.
        * module.c : Add DECL_MIO_NAME for inquiry_type and the mstring
        for inquiry_types.
        (mio_ref): Handle inquiry refs.
        * primary.c (is_inquiry_ref): New function.
        (gfc_match_varspec): Handle inquiry refs calling new function.
        (gfc_variable_attr): Detect inquiry ref for disambiguation
        with components.
        (caf_variable_attr): Treat inquiry and substring refs in the
        same way.
        * resolve.c (find_array_spec): ditto.
        (gfc_resolve_substring_charlen): If there is neither a charlen
        ref not an inquiry ref, return.
        (resolve_ref): Handle inqiry refs as appropriate.
        (resolve_allocate_expr): Entities with an inquiry ref cannot be
        allocated.
        * simplify.c (simplify_bound, simplify_cobound): Punt on
        inquiry refs.
        * trans-array.c (get_array_ctor_var_strlen): Break on inquiry
        ref.
        *trans-expr.c (conv_inquiry): New function.
        (gfc_conv_variable): Retain the last typespec to pass to
        conv_inquiry on detecting an inquiry ref.


2018-11-01  Paul Thomas  <pa...@gcc.gnu.org>

        PR fortran/40196
        * gfortran.dg/inquiry_part_ref_1.f08: New test.
        * gfortran.dg/inquiry_part_ref_2.f90: New test.
        * gfortran.dg/inquiry_part_ref_3.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/inquiry_type_ref_1.f08
    trunk/gcc/testsuite/gfortran.dg/inquiry_type_ref_2.f90
    trunk/gcc/testsuite/gfortran.dg/inquiry_type_ref_3.f90
    trunk/libgfortran/generated/findloc0_c16.c
    trunk/libgfortran/generated/findloc0_c4.c
    trunk/libgfortran/generated/findloc0_c8.c
    trunk/libgfortran/generated/findloc0_i1.c
    trunk/libgfortran/generated/findloc0_i16.c
    trunk/libgfortran/generated/findloc0_i2.c
    trunk/libgfortran/generated/findloc0_i4.c
    trunk/libgfortran/generated/findloc0_i8.c
    trunk/libgfortran/generated/findloc0_r16.c
    trunk/libgfortran/generated/findloc0_r4.c
    trunk/libgfortran/generated/findloc0_r8.c
    trunk/libgfortran/generated/findloc0_s1.c
    trunk/libgfortran/generated/findloc0_s4.c
    trunk/libgfortran/generated/findloc1_c16.c
    trunk/libgfortran/generated/findloc1_c4.c
    trunk/libgfortran/generated/findloc1_c8.c
    trunk/libgfortran/generated/findloc1_i1.c
    trunk/libgfortran/generated/findloc1_i16.c
    trunk/libgfortran/generated/findloc1_i2.c
    trunk/libgfortran/generated/findloc1_i4.c
    trunk/libgfortran/generated/findloc1_i8.c
    trunk/libgfortran/generated/findloc1_r16.c
    trunk/libgfortran/generated/findloc1_r4.c
    trunk/libgfortran/generated/findloc1_r8.c
    trunk/libgfortran/generated/findloc1_s1.c
    trunk/libgfortran/generated/findloc1_s4.c
    trunk/libgfortran/m4/findloc0.m4
    trunk/libgfortran/m4/findloc0s.m4
    trunk/libgfortran/m4/findloc1.m4
    trunk/libgfortran/m4/findloc1s.m4
    trunk/libgfortran/m4/findloc2s.m4
    trunk/libgfortran/m4/ifindloc0.m4
    trunk/libgfortran/m4/ifindloc1.m4
    trunk/libgfortran/m4/ifindloc2.m4
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/dependency.c
    trunk/gcc/fortran/dump-parse-tree.c
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/frontend-passes.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/module.c
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/simplify.c
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog

Reply via email to