[Bug fortran/85542] [6/7/8/9 Regression] ICE in check_inquiry, at fortran/expr.c:2426

2018-05-12 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542

kargl at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #8 from kargl at gcc dot gnu.org ---
Fixed.

[Bug fortran/85542] [6/7/8/9 Regression] ICE in check_inquiry, at fortran/expr.c:2426

2018-05-12 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542

--- Comment #7 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Sat May 12 17:17:19 2018
New Revision: 260198

URL: https://gcc.gnu.org/viewcvs?rev=260198=gcc=rev
Log:
2018-05-12  Steven G. Kargl  

PR fortran/85542
Backport from trunk
* expr.c (check_inquiry): Avoid NULL pointer dereference.

2018-05-11  Steven G. Kargl  

PR fortran/85542
Backport from trunk
* gfortran.dg/pr85542.f90: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/pr85542.f90
Modified:
branches/gcc-6-branch/gcc/fortran/ChangeLog
branches/gcc-6-branch/gcc/fortran/expr.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug fortran/85542] [6/7/8/9 Regression] ICE in check_inquiry, at fortran/expr.c:2426

2018-05-12 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542

--- Comment #6 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Sat May 12 16:57:28 2018
New Revision: 260197

URL: https://gcc.gnu.org/viewcvs?rev=260197=gcc=rev
Log:
2018-05-12  Steven G. Kargl  

PR fortran/85542
Backport from trunk
* expr.c (check_inquiry): Avoid NULL pointer dereference.

2018-05-12  Steven G. Kargl  

PR fortran/85542
Backport from trunk
* gfortran.dg/pr85542.f90: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/pr85542.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/expr.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/85542] [6/7/8/9 Regression] ICE in check_inquiry, at fortran/expr.c:2426

2018-05-12 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542

--- Comment #5 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Sat May 12 16:39:57 2018
New Revision: 260196

URL: https://gcc.gnu.org/viewcvs?rev=260196=gcc=rev
Log:
2018-05-12  Steven G. Kargl  

PR fortran/85542
Backport from trunk
* expr.c (check_inquiry): Avoid NULL pointer dereference.

2018-05-11  Steven G. Kargl  

PR fortran/85542
Backport from trunk
* gfortran.dg/pr85542.f90: New test.

Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/pr85542.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/expr.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug fortran/85542] [6/7/8/9 Regression] ICE in check_inquiry, at fortran/expr.c:2426

2018-05-11 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542

--- Comment #4 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Fri May 11 18:58:21 2018
New Revision: 260182

URL: https://gcc.gnu.org/viewcvs?rev=260182=gcc=rev
Log:
2018-05-11  Steven G. Kargl  

PR fortran/85542
* expr.c (check_inquiry): Avoid NULL pointer dereference.

2018-05-11  Steven G. Kargl  

PR fortran/85542
* gfortran.dg/pr85542.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/pr85542.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/85542] [6/7/8/9 Regression] ICE in check_inquiry, at fortran/expr.c:2426

2018-04-26 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542

--- Comment #3 from Steve Kargl  ---
On Thu, Apr 26, 2018 at 06:47:34PM +, kargl at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542
> 
> --- Comment #2 from kargl at gcc dot gnu.org ---
> (In reply to G. Steinmetz from comment #0)
> > gfortran-8 changed between 20180304 and 20180311.
> > gfortran-7 changed between 20180215 and 20180308.
> > gfortran-6 changed between 20180307 and 20180314.
> > 
> > 
> > $ cat z1.f90
> > function f(x)
> >character(*), intent(in) :: x
> >character((len((x :: f
> >f = x
> > end
> > 
> 
> Workaround: remove superfluous parentheses.
> 

Pesky NULL pointers.

Index: gcc/fortran/expr.c
===
--- gcc/fortran/expr.c  (revision 259653)
+++ gcc/fortran/expr.c  (working copy)
@@ -2422,7 +2422,7 @@ check_inquiry (gfc_expr *e, int not_restricted)

/* Assumed character length will not reduce to a constant expression
   with LEN, as required by the standard.  */
-   if (i == 5 && not_restricted
+   if (i == 5 && not_restricted && ap->expr->symtree
&& ap->expr->symtree->n.sym->ts.type == BT_CHARACTER
&& (ap->expr->symtree->n.sym->ts.u.cl->length == NULL
|| ap->expr->symtree->n.sym->ts.deferred))

[Bug fortran/85542] [6/7/8/9 Regression] ICE in check_inquiry, at fortran/expr.c:2426

2018-04-26 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542

--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to G. Steinmetz from comment #0)
> gfortran-8 changed between 20180304 and 20180311.
> gfortran-7 changed between 20180215 and 20180308.
> gfortran-6 changed between 20180307 and 20180314.
> 
> 
> $ cat z1.f90
> function f(x)
>character(*), intent(in) :: x
>character((len((x :: f
>f = x
> end
> 

Workaround: remove superfluous parentheses.

[Bug fortran/85542] [6/7/8/9 Regression] ICE in check_inquiry, at fortran/expr.c:2426

2018-04-26 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
  Known to work||6.4.0, 7.3.0
   Keywords||ice-on-valid-code
   Last reconfirmed||2018-04-26
 CC||kargl at gcc dot gnu.org
 Ever confirmed|0   |1
   Target Milestone|--- |6.5
  Known to fail||6.4.1, 7.3.1, 8.0.1, 9.0

--- Comment #1 from Dominique d'Humieres  ---
Likely r258347 for gcc8, r258367 for gcc7, and r258368 for gcc6.