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 middle-end/52316] Loops with floating-point iteration variables not optimized away, though result is not used


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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org
            Summary|Loops not optimized away,   |Loops with floating-point
                   |though result is not used   |iteration variables not
                   |                            |optimized away, though
                   |                            |result is not used

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-21 08:50:57 UTC ---
(In reply to comment #1)
> Is it sufficiently common to do something that insane though?

Well, seemingly, other vendors answer this question with yes. The loop is
optimized away with pathf95, openf90, ifort and crayftn.

Whether it is common? I don't know. Some problems can naturally be expressed
with loops which use floating-point (FP) iteration variables (IV). Though, I
assume that a simple FP count ("r = r + 1.0") should be a bit rarer. The
feature was seemingly popular enough that Fortran 77 introduced real/complex IV
in DO loops.

On the other hand, loops with FP IV are ill defined - and that's the presumably
the reason why Fortran 90 has deleted the feature (FP IV in DO loops). But
using WHILE/DO WHILE one can still use floating-point IV - as one can do in
C/C++.


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