[Bug fortran/82606] [PDT] ICE in gfc_extract_int, at fortran/expr.c:641

2017-12-01 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82606

Paul Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Paul Thomas  ---
Fixed. Thanks for the report.

Paul

[Bug fortran/82606] [PDT] ICE in gfc_extract_int, at fortran/expr.c:641

2017-12-01 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82606

--- Comment #9 from Paul Thomas  ---
Author: pault
Date: Fri Dec  1 15:05:55 2017
New Revision: 255311

URL: https://gcc.gnu.org/viewcvs?rev=255311=gcc=rev
Log:
2017-12-01  Paul Thomas  

PR fortran/82605
* resolve.c (get_pdt_constructor): Initialize 'cons' to NULL.
(resolve_pdt): Correct typo in prior comment. Emit an error if
any parameters are deferred and the object is neither pointer
nor allocatable.

PR fortran/82606
* decl.c (gfc_get_pdt_instance): Continue if the parameter sym
is not present or has no name. Select the parameter by name
of component, rather than component order. Remove all the other
manipulations of 'tail' when building the pdt instance.
(gfc_match_formal_arglist): Emit and error if a star is picked
up in a PDT decl parameter list.

PR fortran/82622
* trans-array.c (set_loop_bounds): If a GFC_SS_COMPONENT has an
info->end, use it rather than falling through to
gcc_unreachable.
(structure_alloc_comps): Check that param->name is non-null
before comparing with the component name.
* trans-decl.c (gfc_get_symbol_decl): Do not use the static
initializer for PDT symbols.
(gfc_init_default_dt): Do nothing for PDT symbols.
* trans-io.c (transfer_array_component): Parameterized array
components use the descriptor ubound since the shape is not
available.

PR fortran/82719
PR fortran/82720
* trans-expr.c (gfc_conv_component_ref): Do not use the charlen
backend_decl of pdt strings. Use the hidden component instead.
* trans-io.c (transfer_expr): Do not do IO on "hidden" string
lengths. Use the hidden string length for pdt string transfers
by adding it to the se structure. When finished nullify the
se string length.

PR fortran/82866
* decl.c (gfc_match_formal_arglist): If a name is not found or
star is found, while reading a type parameter list, emit an
immediate error.
(gfc_match_derived_decl): On reading a PDT parameter list, on
failure to match call gfc_error_recovery.

PR fortran/82978
* decl.c (build_struct): Character kind defaults to 1, so use
kind_expr whatever is the set value.
(gfc_get_pdt_instance): Ditto.
* trans-array.c (structure_alloc_comps): Copy the expression
for the PDT string length before parameter substitution. Use
this expression for evaluation and free it after use.

2017-12-01  Paul Thomas  

PR fortran/82605
* gfortran.dg/pdt_4.f03 : Incorporate the new error.

PR fortran/82606
* gfortran.dg/pdt_19.f03 : New test.
* gfortran.dg/pdt_21.f03 : New test.

PR fortran/82622
* gfortran.dg/pdt_20.f03 : New test.
* gfortran.dg/pdt_22.f03 : New test.

PR fortran/82719
PR fortran/82720
* gfortran.dg/pdt_23.f03 : New test.

PR fortran/82866
* gfortran.dg/pdt_24.f03 : New test.

PR fortran/82978
* gfortran.dg/pdt_10.f03 : Correct for error in coding the for
kind 4 component and change the kind check appropriately.
* gfortran.dg/pdt_25.f03 : New test.


Added:
trunk/gcc/testsuite/gfortran.dg/pdt_19.f03
trunk/gcc/testsuite/gfortran.dg/pdt_20.f03
trunk/gcc/testsuite/gfortran.dg/pdt_21.f03
trunk/gcc/testsuite/gfortran.dg/pdt_22.f03
trunk/gcc/testsuite/gfortran.dg/pdt_23.f03
trunk/gcc/testsuite/gfortran.dg/pdt_24.f03
trunk/gcc/testsuite/gfortran.dg/pdt_25.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/resolve.c
trunk/gcc/fortran/trans-array.c
trunk/gcc/fortran/trans-decl.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans-io.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/pdt_10.f03
trunk/gcc/testsuite/gfortran.dg/pdt_4.f03

[Bug fortran/82606] [PDT] ICE in gfc_extract_int, at fortran/expr.c:641

2017-11-29 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82606

--- Comment #8 from Dominique d'Humieres  ---
> Created attachment 42746 [details]
> A fix for the problem

This fix the test in comment 0, but not the one in comment 1.

[Bug fortran/82606] [PDT] ICE in gfc_extract_int, at fortran/expr.c:641

2017-11-29 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82606

Paul Thomas  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org

--- Comment #7 from Paul Thomas  ---
Created attachment 42746
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42746=edit
A fix for the problem

The component initializers were being supplied to the derived type components
in the order of the type_spec_list. Thus, a got a null expression, while b got
the expression for '8'.

Bootstraps and regtests.

Paul

[Bug fortran/82606] [PDT] ICE in gfc_extract_int, at fortran/expr.c:641

2017-10-18 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82606

G. Steinmetz  changed:

   What|Removed |Added

 Blocks||82173
Summary|ICE in gfc_extract_int, at  |[PDT] ICE in
   |fortran/expr.c:641  |gfc_extract_int, at
   ||fortran/expr.c:641

--- Comment #6 from G. Steinmetz  ---
(In reply to Paul Thomas from comment #5)

Thanks for the hint, Paul. Done.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82173
[Bug 82173] [meta-bug] Parameterized derived type errors