This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/48835] Porting GNAT to GNU/Linux/m68k
- From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Jun 2011 21:16:42 +0000
- Subject: [Bug ada/48835] Porting GNAT to GNU/Linux/m68k
- Auto-submitted: auto-generated
- References: <bug-48835-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48835
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ebotcazou at gcc dot
| |gnu.org
--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-06-13 21:16:20 UTC ---
> - __gnat_malloc is defined in Ada to return Address (integer, so in d0), but
> it's called from a couple of places via fake "extern" declarations that pretend
> it returns void* (pointer, so in a0). The attached patch fixes the two call
> sites affected (in Interfaces.C.Strings and build_call_alloc_dealloc), as well
> as the internal fake prototype (init_gigi_decls).
> - Source code inspection showed that get_jmpbuf_address probably suffers from
> the same issue (mismatching decl and use via wrong intermediate fake prototype)
> so I fixed that too.
I don't think that we want __gnat_malloc to return anything else than a pointer
in the GCC representation. Its DECL node is DECL_IS_MALLOC and had better
mimic a canonical malloc as much as possible.
Andreas mentioned a compatibility trick in comment #6. How is it implemented?