implicit gnat_malloc seen as vararg function
BELBACHIR Selim
selim.belbachir@fr.thalesgroup.com
Tue Jun 10 11:32:00 GMT 2014
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
More information about the Gcc
mailing list