[Bug fortran/31593] Invariant DO loop variables and subroutines

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jul 19 17:29:43 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593

--- Comment #50 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(In reply to Thomas Koenig from comment #49)

> The second loop:
> 
> .L3:
> 	leaq	8(%rsp), %rdi
> 	call	intent_in_
> 	movl	%ebx, 8(%rsp)
> 	addl	$1, %ebx
> 	cmpl	$12, %ebx
> 	jne	.L3
> 
> 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.


More information about the Gcc-bugs mailing list