public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30398]  New: memmove for string operations
@ 2007-01-06 22:05 tkoenig at gcc dot gnu dot org
  2007-04-13 15:27 ` [Bug tree-optimization/30398] " tobi at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-01-06 22:05 UTC (permalink / raw)
  To: gcc-bugs

The compiler should be able to detect that s and c
are not aliased, so a call to memcpy instead of memmove
could be issued.

$ cat memmove.f90
program main
  character(len=1) :: s
  character(len=2) :: c
  s = 'a'
  c = repeat(s,2)
end program main
$ gfortran -fdump-tree-original memmove.f90
$ cat memmove.f90.003t.original
MAIN__ ()
{
  char c[1:2];
  char s[1:1];

  _gfortran_set_std (70, 127, 0);
  s[1]{lb: 1 sz: 1} = "a"[1]{lb: 1 sz: 1};
  {
    char str.0[2];

    _gfortran_string_repeat ((char[1:] *) &str.0, 1, &s, 2);
    __builtin_memmove (&c, (char[1:] *) &str.0, 2);
  }
}


-- 
           Summary: memmove for string operations
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-11  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-30398-4@http.gcc.gnu.org/bugzilla/>
2020-11-11  9:31 ` [Bug tree-optimization/30398] memmove for string operations tkoenig at gcc dot gnu.org
2007-01-06 22:05 [Bug fortran/30398] New: " tkoenig at gcc dot gnu dot org
2007-04-13 15:27 ` [Bug tree-optimization/30398] " tobi at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).