This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33097] Function decl trees without proper argument list
- From: "asl at math dot spbu dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Oct 2007 16:45:47 -0000
- Subject: [Bug fortran/33097] Function decl trees without proper argument list
- References: <bug-33097-14919@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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