From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17061 invoked by alias); 17 Oct 2007 16:45:57 -0000 Received: (qmail 17001 invoked by uid 48); 17 Oct 2007 16:45:47 -0000 Date: Wed, 17 Oct 2007 16:45:00 -0000 Message-ID: <20071017164547.17000.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/msg01547.txt.bz2 ------- Comment #9 from asl at math dot spbu dot ru 2007-10-17 16:45 ------- (In reply to comment #3) > Two decls are generated for function x, the first one (inside MAIN__) doesn't > have a proper argument list while the second one is OK. When I try to make > gfortran emit only one decl per externally-visible function, it's currently > choking on this. After some thinking on this example, it seems, I found some solution. My previous approach cannot be completed because of the presence of optional arguments. And even having some valid call, we cannot construct valid decl from this (or we will need some additional logic, which will "complete" such decls). The idea itself is pretty simple: why don't turn external functions/intrinsics into varargs function (in C/C++ sense). In this case trees won't became bogus anymore, however, having call to varargs function can (in theory) disable some optimization performed on it. Attached patch works fine for me. Any comments? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33097