public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/52316] New: Loops not optimized away, though result is not used
@ 2012-02-20 14:56 burnus at gcc dot gnu.org
  2012-02-20 15:11 ` [Bug middle-end/52316] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-20 14:56 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52316
           Summary: Loops not optimized away, though result is not used
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


The following program takes 7.5s without optimization and 1.5s with -O1 to
-Ofast. However, for -Ofast, I had expected that the loops are optimized away.
However, that does not seem to happen.

With "ifort -fast", the program takes "0.0s".


Found at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/5ee459a4ddaeab9e#

program hello
implicit none
real :: x, y, n, i, j, t1, t2
call CPU_TIME(t1)
n = 30000.0
j = 1.0
do while (j < n)
i = 1.0
do while (i < n)
x = sin(45.0) * asin(0.5) * sqrt(5.000000) * atan(2.5555)
 i = i + 1.0
  end do
j = j + 1
end do
call CPU_TIME(t2)
print *, t2-t1
!call sleep(10)
end program hello


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-02-22 19:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-20 14:56 [Bug middle-end/52316] New: Loops not optimized away, though result is not used burnus at gcc dot gnu.org
2012-02-20 15:11 ` [Bug middle-end/52316] " jakub at gcc dot gnu.org
2012-02-20 15:18 ` rguenth at gcc dot gnu.org
2012-02-20 21:54 ` pinskia at gcc dot gnu.org
2012-02-21  9:25 ` [Bug middle-end/52316] Loops with floating-point iteration variables " burnus at gcc dot gnu.org
2012-02-22 19:59 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).