This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/51306] New: MOVE_ALLOC: Make more middle end friendlier


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".)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]