From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22581 invoked by alias); 17 Oct 2007 17:00:46 -0000 Received: (qmail 22536 invoked by uid 48); 17 Oct 2007 17:00:35 -0000 Date: Wed, 17 Oct 2007 17:00:00 -0000 Message-ID: <20071017170035.22535.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/33097] Function decl trees without proper argument list In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "asl at math dot spbu dot ru" 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: 2007-10/txt/msg01551.txt.bz2 ------- Comment #11 from asl at math dot spbu dot ru 2007-10-17 17:00 ------- Also, some chunk of code in function type creation (gfc_get_function_type() is in question) looks suspicious to me. Let me explain on terms of C (I don't know Fortran at all :) ) Consider we have two function decls: int foo1(); struct some_fat_struct foo2(); Both are varargs functions, but return type for the second will be lowered to void, so, after some lowering they in general should look like: int foo(...); void foo2(struct some_fat_struct *retval, ...); The problem with gfortran is that function, which result is passed by reference (determined with help of gfc_return_by_reference() call inside gfc_get_function_type()) won't be varargs, so inside gfortran FE we'll end with something like: void foo2(some_fat_struct *ptr); but: int foo(...); This looks pretty unlogical to me. Was it intentional? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33097