This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52473] CSHIFT slow - inline it?
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 26 Dec 2016 12:25:37 +0000
- Subject: [Bug fortran/52473] CSHIFT slow - inline it?
- Auto-submitted: auto-generated
- References: <bug-52473-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52473
--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Looking at the code, inlining cshift for a constant shift
could already be a good idea.
So, change
b = cshift(b,1) + cshift(b,-1)
to
a = b
b(1) = a(2) + a(n)
b(2:n-1) = a(1:n-2) + a(3:n)
b(n) = a(1) + a(n-1)