[Bug fortran/52473] CSHIFT slow - inline it?

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 26 12:25:00 GMT 2016


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)


More information about the Gcc-bugs mailing list