Commit 852f7e6f by Thomas Koenig

re PR fortran/83224 (creating character array from elements shorter than…

re PR fortran/83224 (creating character array from elements shorter than declared does not pad with whitespace properly and aborts)

2017-12-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/83224
	* frontend-passes.c (realloc_string_callback): Handle
	case for which the RHS is an array expression.

2017-12-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/83224
	* gfortran.dg/dependency_50.f90: New test.

From-SVN: r255294
parent 663c725a
2017-12-01 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/83224
* frontend-passes.c (realloc_string_callback): Handle
case for which the RHS is an array expression.
2017-11-28 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/53796
......
......@@ -249,7 +249,7 @@ realloc_string_callback (gfc_code **c, int *walk_subtrees ATTRIBUTE_UNUSED,
return 0;
expr1 = co->expr1;
if (expr1->ts.type != BT_CHARACTER || expr1->rank != 0
if (expr1->ts.type != BT_CHARACTER
|| !gfc_expr_attr(expr1).allocatable
|| !expr1->ts.deferred)
return 0;
......@@ -270,8 +270,9 @@ realloc_string_callback (gfc_code **c, int *walk_subtrees ATTRIBUTE_UNUSED,
if (!found_substr)
return 0;
}
else if (expr2->expr_type != EXPR_OP
|| expr2->value.op.op != INTRINSIC_CONCAT)
else if (expr2->expr_type != EXPR_ARRAY
&& (expr2->expr_type != EXPR_OP
|| expr2->value.op.op != INTRINSIC_CONCAT))
return 0;
if (!gfc_check_dependency (expr1, expr2, true))
......
2017-12-01 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/83224
* gfortran.dg/dependency_50.f90: New test.
2016-11-17 Kirill Yukhin <kirill.yukhin@gmail.com>
* gcc.target/i386/avx512f-vpcompressb-2.c: Fix popcnt for 32-bit mode.
......
! { dg-do run }
! PR 83224 - dependency mishandling with an array constructor
! Original test case by Urban Jost
program dusty_corner
implicit none
character(len=:),allocatable :: words(:)
words=[character(len=3) :: 'one', 'two']
words=[character(len=5) :: words, 'three']
if (any(words /= [ "one ", "two ", "three"])) call abort
end program dusty_corner
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment