[Bug fortran/54238] If possible, TRANSFER should use assignment instead of MEMCPY

2015-11-08 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54238

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Blocks||36854
 Resolution|--- |WONTFIX

--- Comment #2 from Dominique d'Humieres  ---
> Though the memcpy does get optimized to a VCE:
>   addr.9_4 = (integer(kind=8)) ivtmp.29_28;
>   D.1913_24 = VIEW_CONVERT_EXPR(addr.9_4);

Compiling the code in comment 0 with '-fdump-tree-optimized -O' gives the
following optimized dump for r229946

  :
  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 ;
  else
goto ;

  :

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

[Bug fortran/54238] If possible, TRANSFER should use assignment instead of MEMCPY

2012-08-12 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54238

--- Comment #1 from Andrew Pinski  2012-08-13 
06:15:43 UTC ---
Though the memcpy does get optimized to a VCE:
  addr.9_4 = (integer(kind=8)) ivtmp.29_28;
  D.1913_24 = VIEW_CONVERT_EXPR(addr.9_4);

So it might not be important enough to do at the front-end level.