This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/39280] Optimizing integer power



------- Comment #5 from dominiq at lps dot ens dot fr  2010-05-09 21:29 -------
I am not sure to understand the requested optimization. Is it only for the
special value j=-1 in j**i?

Note that for this situation I hate to rely on the compiler and I use a
"flipper", i.e., I replace

  do i=1,10
    n = (-1)**(i+1)
    call bar(n)
  end do

with

  n = -1
  do i=1,10
    n = -n
    call bar(n)
  end do


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]