Re: [Patc, fortran] PR85603 - ICE with character array substring assignment

2018-10-21 Thread Thomas Koenig
Hi Paul, 2018-10-18 Paul Thomas PR fortran/85603 * frontend-passes.c (get_len_call): New function to generate a call to intrinsic LEN. (create_var): Use this to make length expressions for variable rhs string lengths. Clean up some white space issues. 2018-10-

Re: [Patc, fortran] PR85603 - ICE with character array substring assignment

2018-10-20 Thread Paul Richard Thomas
Hmmm! It helps to provide the patch. 2018-10-18 Paul Thomas PR fortran/85603 * frontend-passes.c (get_len_call): New function to generate a call to intrinsic LEN. (create_var): Use this to make length expressions for variable rhs string lengths. Clean up some white spac

Re: [Patc, fortran] PR85603 - ICE with character array substring assignment

2018-10-20 Thread Paul Richard Thomas
Hi Dominique, Thanks for picking that up. For some reason that I do now see, the regression is caused by the component references. The frontend temporary is picking up the deferred tag from somewhere, even though it is not set. Anyway, all is well if the patch is restricted to character right hand

Re: [Patc, fortran] PR85603 - ICE with character array substring assignment

2018-10-19 Thread Dominique d'Humières
Reduced test ! { dg-do compile } MODULE TN4 IMPLICIT NONE PRIVATE INTEGER,PARAMETER::SH4=KIND('a') TYPE,PUBLIC::TOP CHARACTER(:,KIND=SH4),ALLOCATABLE::ROR CHARACTER(:,KIND=SH4),ALLOCATABLE::VI8 CONTAINS PROCEDURE,NON_OVERRIDABLE::SB=>TPX END TYPE TOP CONTAINS SUBROUTINE T

Re: [Patc, fortran] PR85603 - ICE with character array substring assignment

2018-10-19 Thread Dominique d'Humières
Hi Paul, I get a regression with your patch: obfuscated_tn4.f90:300:0: 300 | TP6%ROR=TP6%ROR(:PP4-1) | internal compiler error: in gfc_trans_deferred_vars, at fortran/trans-decl.c:4754 I’ll try to reduce the test. Dominique

Re: [Patc, fortran] PR85603 - ICE with character array substring assignment

2018-10-18 Thread Paul Richard Thomas
It turned out that this patch did not quite complete the job (Thanks Walt): The ICE has gone but reallocation on assignment is not occurring because the correct string length for the rhs expression was not being picked up. The fix for this took rather more detective work than I anticipated but here

[Patc, fortran] PR85603 - ICE with character array substring assignment

2018-09-22 Thread Paul Richard Thomas
Yet another 'obvious' deferred character fix. Committed to trunk as r264502. Will backport in about ten days time. Paul 2018-09-22 Paul Thomas PR fortran/85603 * trans-array.c (gfc_alloc_allocatable_for_assignment): Test the charlen backend_decl before using the VAR_P macro. 2018