From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15708 invoked by alias); 23 Jun 2011 02:55:21 -0000 Received: (qmail 15695 invoked by uid 22791); 23 Jun 2011 02:55:20 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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; Thu, 23 Jun 2011 02:55:07 +0000 From: "stevenj at alum dot mit.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49509] cannot promote types for arguments passed by value X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stevenj at alum dot mit.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: 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 Date: Thu, 23 Jun 2011 02:55:00 -0000 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: 2011-06/txt/msg02040.txt.bz2 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. 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. 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. Hence, the familiar old requirements of the Fortran standard are irrelevant. The question is, what does the Fortran 2003 standard require for passing by value, which is I believe is NEW IN FORTRAN 2003, and is SPECIFIC TO BIND(C) functions.