From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 02B99385702D; Sun, 19 Jul 2020 17:29:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02B99385702D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595179784; bh=RJis6sqzBpV4PrEnW80hXQbgHsEcX7dXYmSNjX54+Sc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=y5OjV4/CTIBOCH4u1T9Qjm7gY5hFakFan/VgnOvvsENS4stQGgoJ80rZZ0damueJq Y0/vlG2Lcmeq8RTGc/FKR/ogk2KiX72UJ4MftJ/wkrIiktpeGiJL61l9VchbycZ0Iv OgTB8AZuiWMJsCNKVrWe96VWkyjnE+pfwfqd6+iY= From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/31593] Invariant DO loop variables and subroutines Date: Sun, 19 Jul 2020 17:29:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.3.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2020 17:29:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D31593 --- Comment #50 from Thomas Koenig --- (In reply to Thomas Koenig from comment #49) > The second loop: >=20 > .L3: > leaq 8(%rsp), %rdi > call intent_in_ > movl %ebx, 8(%rsp) > addl $1, %ebx > cmpl $12, %ebx > jne .L3 >=20 > No reload from the stack, but not quite ideal yet. That > movl %ebx, 8(%rsp) would have been unneeded had one of the > callee-saved registers been used. Actually, that comment is not correct - we need to store the value of the argument so the subroutine an access it. So, we're just seeing the inevitable overhead of passing by reference here.=