This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/39280] Optimizing integer power
- From: "dominiq at lps dot ens dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 May 2010 21:29:37 -0000
- Subject: [Bug fortran/39280] Optimizing integer power
- References: <bug-39280-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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