[Bug fortran/49509] cannot promote types for arguments passed by value
sgk at troutmask dot apl.washington.edu
gcc-bugzilla@gcc.gnu.org
Thu Jun 23 04:02:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49509
--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2011-06-23 04:01:49 UTC ---
On Thu, Jun 23, 2011 at 02:55:20AM +0000, stevenj at alum dot mit.edu wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49509
>
> --- Comment #2 from stevenj at alum dot mit.edu 2011-06-23 02:54:50 UTC ---
> You're missing the point.
Ah, no. I believe I understand what you want.
> Traditionally in Fortran, all arguments were passed *by reference*,
> in which case it is clearly a requirement that actual parameter
> match the formal parameter's type exactly, because the formal parameter refers
> to the *same memory* as the actual parameter.
Traditionally, the standard was silent on the passing
mechanism. It could have been accomplished by chipmunks.
> However, in this case we are passing by value. This should act
> just like an assignment of the formal parameter to the actual
> parameter (as opposed to having them be the *same* object as
> in passing by reference). Hence, just like an assignment statement
> the compiler should be able to assign a narrower
> integer type to a wider one.
That's not what the standard mandates.
More information about the Gcc-bugs
mailing list