Re: [PATCH] PR fortran/100950 - ICE in output_constructor_regular_field, at varasm.c:5514

2021-06-10 Thread Bernhard Reutner-Fischer via Fortran
On Wed, 9 Jun 2021 23:39:45 +0200 Harald Anlauf via Gcc-patches wrote: > diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c > index c27b47aa98f..016ec259518 100644 > --- a/gcc/fortran/simplify.c > +++ b/gcc/fortran/simplify.c > @@ -4512,6 +4512,60 @@ gfc_simplify_leadz (gfc_expr *e) >

Re: [PATCH] PR fortran/100950 - ICE in output_constructor_regular_field, at varasm.c:5514

2021-06-10 Thread Bernhard Reutner-Fischer via Fortran
On Thu, 10 Jun 2021 12:24:35 +0200 Bernhard Reutner-Fischer wrote: > On Wed, 9 Jun 2021 23:39:45 +0200 > Harald Anlauf via Gcc-patches wrote: > > +/* Check for constant length of a substring. */ > > + > > +static bool > > +substring_has_constant_len (gfc_expr *e) > > +{ > > + ptrdiff_t istart

Re: [PATCH] PR fortran/100950 - ICE in output_constructor_regular_field, at varasm.c:5514

2021-06-10 Thread Harald Anlauf via Fortran
Hi Bernhard, > > +static bool > > +substring_has_constant_len (gfc_expr *e) > > +{ > > + ptrdiff_t istart, iend; > > + size_t length; > > + bool equal_length = false; > > + > > + if (e->ts.type != BT_CHARACTER > > + || !(e->ref && e->ref->type == REF_SUBSTRING) > > iff we ever can get her

Re: [PATCH] PR fortran/100950 - ICE in output_constructor_regular_field, at varasm.c:5514

2021-06-10 Thread Bernhard Reutner-Fischer via Fortran
On 10 June 2021 20:52:12 CEST, Harald Anlauf wrote: >> I think the mpz_set_si args above fit on one line. > >That's true. > >Since this block is exactly the same as for constant strings, >which is handled in the first condition, I've thought some more >and am convinced now that these two can be f