This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49509] cannot promote types for arguments passed by value
- From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Jun 2011 04:02:06 +0000
- Subject: [Bug fortran/49509] cannot promote types for arguments passed by value
- Auto-submitted: auto-generated
- References: <bug-49509-4@http.gcc.gnu.org/bugzilla/>
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.