This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54238] If possible, TRANSFER should use assignment instead of MEMCPY
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 08 Nov 2015 15:05:23 +0000
- Subject: [Bug fortran/54238] If possible, TRANSFER should use assignment instead of MEMCPY
- Auto-submitted: auto-generated
- References: <bug-54238-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54238
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Blocks| |36854
Resolution|--- |WONTFIX
--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Though the memcpy does get optimized to a VCE:
> addr.9_4 = (integer(kind=8)) ivtmp.29_28;
> D.1913_24 = VIEW_CONVERT_EXPR<void *>(addr.9_4);
Compiling the code in comment 0 with '-fdump-tree-optimized -O' gives the
following optimized dump for r229946
<bb 3>:
transfer.1_25 = (integer(kind=8)) &array;
i.5_6 = i;
_7 = i.5_6 * 32;
_8 = _7 / 8;
_9 = (integer(kind=8)) _8;
addr.8_10 = _9 + transfer.1_25;
transfer.2_27 = (void *) addr.8_10;
dt_parm.3.common.filename = &"pr54238.f90"[1]{lb: 1 sz: 1};
dt_parm.3.common.line = 13;
dt_parm.3.common.flags = 128;
dt_parm.3.common.unit = 6;
_gfortran_st_write (&dt_parm.3);
_gfortran_transfer_integer_write (&dt_parm.3, &i, 4);
_gfortran_transfer_character_write (&dt_parm.3, &": "[1]{lb: 1 sz: 1}, 2);
_gfortran_transfer_integer_write (&dt_parm.3, transfer.2_27, 4);
_gfortran_st_write_done (&dt_parm.3);
dt_parm.3 ={v} {CLOBBER};
i.9_21 = i.5_6 + 1;
i = i.9_21;
if (i.5_6 == 3)
goto <bb 4>;
else
goto <bb 3>;
<bb 4>:
So the __builtin_memcpy are aleready optimized with -O.
> So it might not be important enough to do at the front-end level.
Agreed. Closing as WONTFIX.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36854
[Bug 36854] [meta-bug] fortran front-end optimization