[multiple changes]

2016-11-09  Mikael Morin  <mikael@gcc.gnu.org>
	    Janus Weil  <janus@gcc.gnu.org>

	PR fortran/46459
	* interface.c (compare_actual_formal): Add safety checks to avoid ICE.

2016-11-09  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/46459
	* gfortran.dg/volatile14.f90: New test.

From-SVN: r242020
This commit is contained in:
Janus Weil 2016-11-09 21:33:24 +01:00
parent e922b25690
commit 271dd55c78
4 changed files with 43 additions and 1 deletions

View File

@ -1,10 +1,16 @@
2016-11-09 Mikael Morin <mikael@gcc.gnu.org>
Janus Weil <janus@gcc.gnu.org>
PR fortran/46459
* interface.c (compare_actual_formal): Add safety checks to avoid ICE.
2016-11-09 Fritz O. Reese <fritzoreese@gmail.com>
PR fortran/78259
* trans-expr.c (gfc_trans_subcomponent_assign): Guard against NULL
values.
2016-11-09 Steve Kargl <kargl@gcc.gnu.org>
2016-11-09 Steven G. Kargl <kargl@gcc.gnu.org>
Janus Weil <janus@gcc.gnu.org>
PR fortran/60777

View File

@ -3190,6 +3190,7 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
shape array, if the dummy argument has the VOLATILE attribute. */
if (f->sym->attr.volatile_
&& a->expr->expr_type == EXPR_VARIABLE
&& a->expr->symtree->n.sym->as
&& a->expr->symtree->n.sym->as->type == AS_ASSUMED_SHAPE
&& !(f->sym->as && f->sym->as->type == AS_ASSUMED_SHAPE))
@ -3219,6 +3220,7 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
dummy argument has the VOLATILE attribute. */
if (f->sym->attr.volatile_
&& a->expr->expr_type == EXPR_VARIABLE
&& a->expr->symtree->n.sym->attr.pointer
&& a->expr->symtree->n.sym->as
&& !(f->sym->as

View File

@ -1,3 +1,8 @@
2016-11-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/46459
* gfortran.dg/volatile14.f90: New test.
2016-11-09 Uros Bizjak <ubizjak@gmail.com>
PR target/78262

View File

@ -0,0 +1,29 @@
! { dg-do compile }
!
! PR 46459: ICE (segfault): Invalid read in compare_actual_formal [error recovery]
!
! Contributed by Harald Anlauf <anlauf@gmx.de>
call sub (1)
contains
subroutine sub (j)
integer, volatile :: j
end subroutine
end
subroutine sub1 ()
call sub2 (1) ! { dg-error "Explicit interface required" }
end subroutine
subroutine sub2 (j)
integer, volatile :: j
end subroutine
subroutine sub3 ()
interface
subroutine sub2 (j)
integer, volatile :: j
end subroutine
end interface
call sub2 (1)
end subroutine