This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/69268] [5 Regression] Sourced allocation calls function twice
- From: "vehre at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 27 Jan 2016 14:48:45 +0000
- Subject: [Bug fortran/69268] [5 Regression] Sourced allocation calls function twice
- Auto-submitted: auto-generated
- References: <bug-69268-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69268
--- Comment #4 from vehre at gcc dot gnu.org ---
Author: vehre
Date: Wed Jan 27 14:48:04 2016
New Revision: 232876
URL: https://gcc.gnu.org/viewcvs?rev=232876&root=gcc&view=rev
Log:
gcc/testsuite/ChangeLog:
2016-01-27 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/69268
* gfortran.dg/allocatable_scalar_13.f90: Fixing counts of malloc/
free to fit the actual number of calls.
* gfortran.dg/allocate_with_source_16.f90: New test.
gcc/fortran/ChangeLog:
2016-01-27 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/69268
* trans-stmt.c (gfc_trans_allocate): Make sure the source=
expression is evaluated once only. Use gfc_trans_assignment ()
instead of explicitly calling gfc_trans_string_copy () to
reduce the code complexity in trans_allocate.
Added:
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/allocate_with_source_16.f90
Modified:
branches/gcc-5-branch/gcc/fortran/ChangeLog
branches/gcc-5-branch/gcc/fortran/trans-stmt.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/allocatable_scalar_13.f90