[Bug fortran/93600] [10 Regression] ICE in gfc_match_assignment, at fortran/match.c:1366/1340

2020-03-24 Thread markeggleston at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93600

markeggleston at gcc dot gnu.org changed:

   What|Removed |Added

 CC||markeggleston at gcc dot 
gnu.org
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from markeggleston at gcc dot gnu.org ---
commit https://gcc.gnu.org/g:b0d84ecc55f3ea86764b119040c5ffde36cd0524

[Bug fortran/93600] [10 Regression] ICE in gfc_match_assignment, at fortran/match.c:1366/1340

2020-03-23 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93600

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Mark Eggleston
:

https://gcc.gnu.org/g:b0d84ecc55f3ea86764b119040c5ffde36cd0524

commit r10-7334-gb0d84ecc55f3ea86764b119040c5ffde36cd0524
Author: Mark Eggleston 
Date:   Mon Mar 23 14:42:20 2020 +

fortran: ICE in gfc_match_assignment PR93600

This patch builds on the original patch by Steve Kargl that fixed the
ICE and produced an "Unclassifiable statement at (1)" error. The
processing of parameter variables now correctly handles zero length
arrays used with %kind and %len. A side affect is that "Unclassifiable"
error now says "Assignment to constant expression at (1)". It also
fixes PR93365.

gcc/fortran/ChangeLog:

PR fortran/93600
* expr.c (simplify_parameter_variable): Check whether the ref
chain contains INQUIRY_LEN or INQUIRY_KIND and set inquiry
boolean. When an empty array has been identified and a new
new EXPR_ARRAY expression has been created only return that
expression if inquiry is not set. This allows the new
expression to drop through to be simplified into a
EXPR_CONSTANT representing %kind or %len.
* match.c (gfc_match_assignment): If lvalue doesn't have a
symtree free both lvalue and rvalue expressions and return
an error.
* resolv.c (gfc_resolve_ref): Ensure that code to handle
INQUIRY_LEN is only performed for arrays with deferred types.

gcc/testsuite/ChangeLog:

PR fortran/93365
PR fortran/93600
* gfortran.dg/pr93365.f90: New test.
* gfortran.dg/pr93600_1.f90: New test.
* gfortran.dg/pr93600_2.f90: New test.

[Bug fortran/93600] [10 Regression] ICE in gfc_match_assignment, at fortran/match.c:1366/1340

2020-02-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93600

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |10.0

[Bug fortran/93600] [10 Regression] ICE in gfc_match_assignment, at fortran/match.c:1366/1340

2020-02-05 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93600

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-02-06
 CC||kargl at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from kargl at gcc dot gnu.org ---
The patch against svn r280157 removes the ICE, and allows for the
dreaded 'Unclassiable statement at (1)' error.

Index: gcc/fortran/match.c
===
--- gcc/fortran/match.c (revision 280157)
+++ gcc/fortran/match.c (working copy)
@@ -1363,6 +1373,13 @@ gfc_match_assignment (void)
   return m;
 }

+  if (!lvalue->symtree)
+{
+  gfc_free_expr (lvalue);
+  gfc_free_expr (rvalue);
+  return MATCH_ERROR;
+}
+
   gfc_set_sym_referenced (lvalue->symtree->n.sym);

   new_st.op = EXEC_ASSIGN;

[Bug fortran/93600] [10 Regression] ICE in gfc_match_assignment, at fortran/match.c:1366/1340

2020-02-05 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93600

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code

--- Comment #1 from G. Steinmetz  ---

Related :


$ cat z2.f90
program p
   character(0), parameter :: c(0) = ''
   if ( size(c) /= 0 ) stop
   if ( len(c) /= 0 ) stop
   c%len = 'a'
end


$ gfortran-10-20200202 -c z2.f90
f951: internal compiler error: in gfc_match_varspec, at fortran/primary.c:2389
0x6ac1fd gfc_match_varspec(gfc_expr*, int, bool, bool)
../../gcc/fortran/primary.c:2389
0x6ac392 match_variable
../../gcc/fortran/primary.c:4038
0x67b0a6 gfc_match(char const*, ...)
../../gcc/fortran/match.c:1162
0x67c94c gfc_match_assignment()
../../gcc/fortran/match.c:1340
0x6a06e0 match_word
../../gcc/fortran/parse.c:65
0x6a06e0 decode_statement
../../gcc/fortran/parse.c:361
0x6a21da next_free
../../gcc/fortran/parse.c:1279
0x6a21da next_statement
../../gcc/fortran/parse.c:1511
0x6a4fa0 parse_executable
../../gcc/fortran/parse.c:5607
0x6a669f parse_progunit
../../gcc/fortran/parse.c:5877
0x6a7cd9 gfc_parse_file()
../../gcc/fortran/parse.c:6392
0x6f295f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:210