This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
implicit gnat_malloc seen as vararg function
- From: BELBACHIR Selim <selim dot belbachir at fr dot thalesgroup dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 10 Jun 2014 13:32:35 +0200
- Subject: implicit gnat_malloc seen as vararg function
- Authentication-results: sourceware.org; auth=none
Hi,
I'm working on a private port of GCC 4.7.3/GNAT 7.1.2.
Calls to ADA 'new' operator generates implicit gnat_malloc(size) calls (which has to be provided by user program or runtime).
In my macro INIT_CUMULATIVE_ARGS I noticed that gnat_malloc(size) calls are seen as vararg function because the tree.c function stdarg_p(fntype) returns true. This creates bad code because caller put the argument in stack (this is normal behaviour for my vararg functions) whereas the callee expected argument in register (gnat_malloc signature should only contains the 'size' argument of type size_type).
microblaze and iq2000 backend should have the same problem because inside INIT_CUMULATIVE_ARGS macro, variable argument function are identified by browsing fntype tree chain (like stdarg_p does)
Do I have to fix the GNAT frontend or did I missed an option dealing with gnat_malloc behaviour ?
Regards,
Selim Belbachir