------- Comment #2 from fxcoudert at gcc dot gnu dot org  2007-01-22 10:02 
-------
(In reply to comment #1)
> Or, even better, the memmove/memcpy could be ommitted completely,
> by using the variable directly as the target.

The string_repeat() function could be generated directly by the front-end,
because it's really simple code:

void
string_repeat (char * dest, GFC_INTEGER_4 slen,
               const char * src, GFC_INTEGER_4 ncopies)
{
  int i;

  /* See if ncopies is valid.  */
  if (ncopies < 0)
    {
      /* The error is already reported.  */
      runtime_error ("Augument NCOPIES is negative.");
    }

  /* Copy characters.  */
  for (i = 0; i < ncopies; i++)
    {
      memmove (dest + (i * slen), src, slen);
    }
}


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-01-22 10:02:53
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30398

Reply via email to