From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17477 invoked by alias); 26 May 2010 21:07:42 -0000 Received: (qmail 17468 invoked by uid 22791); 26 May 2010 21:07:41 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 May 2010 21:07:37 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id BF222CB02D5; Wed, 26 May 2010 23:07:40 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JXB16PvrCsCo; Wed, 26 May 2010 23:07:40 +0200 (CEST) Received: from [192.168.1.2] (91-172-110-191.rev.libertysurf.net [91.172.110.191]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 69095CB01DB; Wed, 26 May 2010 23:07:40 +0200 (CEST) From: Eric Botcazou To: Steven Bosscher Subject: Re: RFH: gen_rtx_MEM / gen_rtx_CONST in ada front-end code Date: Wed, 26 May 2010 21:22:00 -0000 User-Agent: KMail/1.9.9 Cc: GCC Mailing List References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201005262304.04874.ebotcazou@adacore.com> Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-05/txt/msg00586.txt.bz2 > Could you please help me with some code in > ada/gcc-interface/decl.c::gnat_to_gnu_entity: > > /* For a debug renaming declaration, build a pure debug entity. */ > if (Present (Debug_Renaming_Link (gnat_entity))) > { > rtx addr; > gnu_decl = build_decl (input_location, > VAR_DECL, gnu_entity_name, gnu_type); > /* The (MEM (CONST (0))) pattern is prescribed by STABS. */ > if (global_bindings_p ()) > addr = gen_rtx_CONST (VOIDmode, const0_rtx); > else > addr = stack_pointer_rtx; > SET_DECL_RTL (gnu_decl, gen_rtx_MEM (Pmode, addr)); > gnat_pushdecl (gnu_decl, gnat_entity); > break; > } It's a gigi hack to support a front-end kludge. :-) > I would like to remove this code from ada, but I am not sure what the > purpose of this code is. What should I do with this code? The goal is to build a pure debugging variable, i.e. a variable that will be present only in the debug info. GDB is supposed to magically recognize its name and deduce something from its presence in the scope. This was done this way to prevent debug stuff from altering code generation and avoid wasting space. Yes, the whole design is questionable, give me a few days to investigate whether it can be modified. -- Eric Botcazou