re PR fortran/55692 (ICE on incorrect use of ASSOCIATED function)

2012-12-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/55692
	* check.c (gfc_check_associated): Remove a "gcc_assert (0)".

2012-12-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/55692
	* gfortran.dg/associated_7.f90: New.

From-SVN: r194744
This commit is contained in:
Janus Weil 2012-12-28 16:14:45 +01:00
parent f968d60be0
commit 5fabac29f7
4 changed files with 22 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2012-12-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/55692
* check.c (gfc_check_associated): Remove a "gcc_assert (0)".
2012-12-28 Tobias Burnus <burnus@net-b.de>
PR fortran/55763

View File

@ -895,12 +895,10 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
where = &pointer->where;
if (pointer->expr_type == EXPR_VARIABLE || pointer->expr_type == EXPR_FUNCTION)
attr1 = gfc_expr_attr (pointer);
else if (pointer->expr_type == EXPR_NULL)
if (pointer->expr_type == EXPR_NULL)
goto null_arg;
else
gcc_assert (0); /* Pointer must be a variable or a function. */
attr1 = gfc_expr_attr (pointer);
if (!attr1.pointer && !attr1.proc_pointer)
{

View File

@ -1,3 +1,8 @@
2012-12-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/55692
* gfortran.dg/associated_7.f90: New.
2012-12-28 Tobias Burnus <burnus@net-b.de>
PR fortran/55763

View File

@ -0,0 +1,9 @@
! { dg-do compile }
!
! PR 55692: ICE on incorrect use of ASSOCIATED function
!
! Contributed by Gilbert Scott <gilbert.scott@easynet.co.uk>
INTEGER, POINTER :: P1, P2
PRINT *, ASSOCIATED([P1,P2]) ! { dg-error "must be a POINTER" }
END