Commit dc2c36fd by Thomas Koenig

re PR fortran/62214 (Problem with spread plus concatenation for characters)

2014-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/62214
	* frontend-passes.c (optimize_binop_array_assignment):
	Do not try to optimize the array assignment for string
	concatenation.

2014-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/62214
	* gfortran.dg/array_assignment_5.f90:  New test.

From-SVN: r214281
parent 4e502930
2014-08-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/62214
* frontend-passes.c (optimize_binop_array_assignment):
Do not try to optimize the array assignment for string
concatenation.
2014-08-21 Manuel López-Ibáñez <manu@gcc.gnu.org> 2014-08-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054 PR fortran/44054
......
...@@ -903,6 +903,10 @@ optimize_binop_array_assignment (gfc_code *c, gfc_expr **rhs, bool seen_op) ...@@ -903,6 +903,10 @@ optimize_binop_array_assignment (gfc_code *c, gfc_expr **rhs, bool seen_op)
return true; return true;
break; break;
case INTRINSIC_CONCAT:
/* Do not do string concatenations. */
break;
default: default:
/* Binary operators. */ /* Binary operators. */
if (optimize_binop_array_assignment (c, &e->value.op.op1, true)) if (optimize_binop_array_assignment (c, &e->value.op.op1, true))
......
2014-08-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/62214
* gfortran.dg/array_assignment_5.f90: New test.
2014-08-21 Sandra Loosemore <sandra@codesourcery.com> 2014-08-21 Sandra Loosemore <sandra@codesourcery.com>
* lib/target-supports.exp * lib/target-supports.exp
...@@ -9,7 +14,7 @@ ...@@ -9,7 +14,7 @@
* gcc.dg/tree-ssa/interposition.c: Require fpic effective target * gcc.dg/tree-ssa/interposition.c: Require fpic effective target
for test using -fPIC. for test using -fPIC.
* gcc.dg/lto/pr61526_0.c: Likewise. * gcc.dg/lto/pr61526_0.c: Likewise.
2014-08-21 Jan Hubicka <hubicka@ucw.cz> 2014-08-21 Jan Hubicka <hubicka@ucw.cz>
PR tree-optimization/62091 PR tree-optimization/62091
......
! { dg-do run }
! { dg-options "-ffrontend-optimize" }
! PR 62214 - this used to give the wrong result.
! Original test case by Oliver Fuhrer
PROGRAM test
IMPLICIT NONE
CHARACTER(LEN=20) :: fullNames(2)
CHARACTER(LEN=255) :: pathName
CHARACTER(LEN=5) :: fileNames(2)
pathName = "/dir1/dir2/"
fileNames = (/ "file1", "file2" /)
fullNames = SPREAD(TRIM(pathName),1,2) // fileNames
if (fullNames(1) /= '/dir1/dir2/file1' .or. &
& fullnames(2) /= '/dir1/dir2/file2') call abort
END PROGRAM test
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