From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30385 invoked by alias); 21 Feb 2012 08:51:41 -0000 Received: (qmail 30376 invoked by uid 22791); 21 Feb 2012 08:51:40 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Feb 2012 08:51:28 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/52316] Loops with floating-point iteration variables not optimized away, though result is not used Date: Tue, 21 Feb 2012 09:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Summary Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg02042.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52316 Tobias Burnus 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 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++.