This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/56872] [4.8/4.9 Regression] Incorrect SUM evaluation, involving implied-do loop, with -ffrontend-optimize
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 08 Apr 2013 16:39:10 +0000
- Subject: [Bug fortran/56872] [4.8/4.9 Regression] Incorrect SUM evaluation, involving implied-do loop, with -ffrontend-optimize
- Auto-submitted: auto-generated
- References: <bug-56872-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56872
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-04-08 16:39:10 UTC ---
Front-end optimization generates for
print *,SUM([(s**(REAL(k-1)/REAL(m-1)),k=1,m)])
the code:
D.1918 = s;
D.1919 = __builtin_powf (D.1918, (((real(kind=4)) (k + -1) / (real(kind=4))
(m + -1))));
Completely ignoring that "k" is a loop variable, which is not even set.