From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 476 invoked by alias); 13 Jun 2011 21:16:57 -0000 Received: (qmail 464 invoked by uid 22791); 13 Jun 2011 21:16:56 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Jun 2011 21:16:42 +0000 From: "ebotcazou at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/48835] Porting GNAT to GNU/Linux/m68k X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: ebotcazou at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 13 Jun 2011 21:16:00 -0000 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: 2011-06/txt/msg01149.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48835 Eric Botcazou changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot | |gnu.org --- Comment #9 from Eric Botcazou 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?