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

--- Comment #12 from kargl at gcc dot gnu.org ---
(In reply to Gerhard Steinmetz from comment #11)
> And with "kind=4" instead of "kind=1", i.e. with testfile z1.f90 ?
> 
> 
> for n in `seq 1 1000`
> do
>    gfortran-7-20160821 -O2 -mavx -c z1.f90
> done > list 2>&1
> 
> grep 'internal compiler' list | wc
>     946    5676   47300
> 
> 
> I can also confirm that ICEs are gone for z2.f90 ("kind=1").

Ugh.  I was testing apparently a kind=1 version.  The problem
is that gfortran is inserting __convert_s1_s4 to convert to
the same kind, which of course fails.  This un-regression-tested
patch covers up the ICE, but it is perhaps not the correct fix.
Fortunately, I don't use kind=4 character types, so I don't have
a dog in this fight.

Index: primary.c
===================================================================
--- primary.c   (revision 239661)
+++ primary.c   (working copy)
@@ -1105,8 +1105,8 @@ got_delim:
       if (ret == -2)
        {
          gfc_current_locus = start_locus;
-         gfc_error ("Unterminated character constant beginning at %C");
-         return MATCH_ERROR;
+         gfc_error_now ("Unterminated character constant beginning at %C");
+         return MATCH_NO;
        }

       length++;

Reply via email to