This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/51306] New: MOVE_ALLOC: Make more middle end friendlier
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 25 Nov 2011 17:35:52 +0000
- Subject: [Bug fortran/51306] New: MOVE_ALLOC: Make more middle end friendlier
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51306
Bug #: 51306
Summary: MOVE_ALLOC: Make more middle end friendlier
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
Currently, for MOVE_ALLOC, _gfortran_move_alloc(from, to) is called, which
frees to->data, copies manually all data from "from" to "to" and then sets
to->data = NULL.
I think it should be possible to replace the call by a much more middle-end
friendly:
free (to->data); // seemingly already exists in the caller
*to = *from
from = NULL;
I do not see anything which speaks against it as every field of the array
descriptor seems to be copied. (If this is not possible, one should move all
nonarray descriptor stuff, especially the "from = NULL" to the front end and
use a "fn spec".)