[multiple changes]

2016-12-02  Janus Weil  <janus@gcc.gnu.org>
	    Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78618
	* check.c (gfc_check_rank): Remove ATTRIBUTE_UNUSED.
	* expr.c (gfc_check_assign): Fix error propagation.

2016-12-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78618
	* gfortran.dg/char_conversion.f90: New test.

From-SVN: r243201
This commit is contained in:
Janus Weil 2016-12-02 19:38:24 +01:00
parent 827ab47ab1
commit 6ed022af2a
5 changed files with 26 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2016-12-02 Janus Weil <janus@gcc.gnu.org>
Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78618
* check.c (gfc_check_rank): Remove ATTRIBUTE_UNUSED.
* expr.c (gfc_check_assign): Fix error propagation.
2016-12-01 Elizebeth Punnoose <elizebeth.punnoose@hpe.com>
PR fortran/77505

View File

@ -3667,7 +3667,7 @@ gfc_check_range (gfc_expr *x)
bool
gfc_check_rank (gfc_expr *a ATTRIBUTE_UNUSED)
gfc_check_rank (gfc_expr *a)
{
/* Any data object is allowed; a "data object" is a "constant (4.1.3),
variable (6), or subobject of a constant (2.4.3.2.3)" (F2008, 1.3.45). */

View File

@ -3314,9 +3314,9 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform,
if (lvalue->ts.type == BT_CHARACTER && rvalue->ts.type == BT_CHARACTER)
{
if (lvalue->ts.kind != rvalue->ts.kind && allow_convert)
gfc_convert_chartype (rvalue, &lvalue->ts);
return true;
return gfc_convert_chartype (rvalue, &lvalue->ts);
else
return true;
}
if (!allow_convert)

View File

@ -1,3 +1,8 @@
2016-12-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78618
* gfortran.dg/char_conversion.f90: New test.
2016-12-02 Jakub Jelinek <jakub@redhat.com>
PR target/70322

View File

@ -0,0 +1,10 @@
! { dg-do compile }
!
! PR 78618: ICE in gfc_check_rank, at fortran/check.c:3670
!
! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
program p
character, parameter :: c = char(256,4) ! { dg-error "cannot be converted" }
if (rank(c) /= 0) call abort
end