public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/31016] New: Use __buildin_memcpy and __memcpy for array assignment Date: Thu, 01 Mar 2007 18:55:00 -0000 [thread overview] Message-ID: <bug-31016-13404@http.gcc.gnu.org/bugzilla/> (raw) For the most common array assignments where the size is known at compile-time, we already use __buildin_memcpy; but the following cases were missed: subroutine bar(a) implicit none real :: a(*),b(12) b = a(1:12) end subroutine subroutine bar(a,b) implicit none real :: a(*),b(*) a(1:12) = b(2:13) end subroutine And __buildin_memset can be used for: subroutine bar(a) implicit none real :: a(*),b(12) a(1:12) = 12 end subroutine For the following examples, the __buildin_* function can not be used as the size is not known at compile time, but the memory should be contiguous and thus __memcpy can be used: subroutine bar(a,n) implicit none integer :: n real :: a(n), b(n) a = b end subroutine For the following case, one could use memset, but I'm not sure whether it will be on average be faster than a normal do loop. (Overhead of function call versus the optimization of memset using e.g. copy-on-write.) subroutine bar(a,n) implicit none integer :: n real :: a(n) a = 5 end subroutine -- Summary: Use __buildin_memcpy and __memcpy for array assignment 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: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31016
next reply other threads:[~2007-03-01 18:55 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-03-01 18:55 burnus at gcc dot gnu dot org [this message] 2007-03-01 19:16 ` [Bug fortran/31016] " burnus at gcc dot gnu dot org 2007-03-01 19:27 ` burnus at gcc dot gnu dot org 2007-03-01 19:35 ` tkoenig at gcc dot gnu dot org 2007-04-29 10:46 ` jb at gcc dot gnu dot org 2007-04-30 16:25 ` pinskia at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-31016-13404@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).