From patchwork Mon Aug 2 13:40:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 60535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5A262B6EE8 for ; Mon, 2 Aug 2010 23:41:03 +1000 (EST) Received: (qmail 23274 invoked by alias); 2 Aug 2010 13:40:48 -0000 Received: (qmail 23247 invoked by uid 22791); 2 Aug 2010 13:40:43 -0000 X-SWARE-Spam-Status: No, hits=-2.2 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; Mon, 02 Aug 2010 13:40:36 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id A41DCCB02BA; Mon, 2 Aug 2010 15:40:38 +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 vRud2oC2SQnW; Mon, 2 Aug 2010 15:40:38 +0200 (CEST) Received: from adijon-256-1-121-88.w90-6.abo.wanadoo.fr (ADijon-256-1-121-88.w90-6.abo.wanadoo.fr [90.6.120.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 7A63BCB0266; Mon, 2 Aug 2010 15:40:38 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Don't generate RTL in gigi Date: Mon, 2 Aug 2010 15:40:28 +0200 User-Agent: KMail/1.9.9 Cc: Steven Bosscher MIME-Version: 1.0 Message-Id: <201008021540.28908.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This eliminates the (presumably) last bits of RTL generation in gigi. Tested on x86-64-suse-linux. Steven, let me know if I've forgotten something. 2010-08-02 Eric Botcazou * gcc-interface/decl.c: Do not undefine N_GCC_FRONTEND and do not include expr.h. (gnat_to_gnu_entity) : Force address of -1 at the tree level for the debug-only entity. * gcc-interface/Make-lang.in (ada/decl.o): Adjust dependencies. Index: gcc-interface/decl.c =================================================================== --- gcc-interface/decl.c (revision 162622) +++ gcc-interface/decl.c (working copy) @@ -23,10 +23,6 @@ * * ****************************************************************************/ -/* FIXME: Still need to include rtl.h here (via expr.h) because this file - actually generates RTL (search for gen_rtx_* in gnat_to_gnu_entity). */ -#undef IN_GCC_FRONTEND - #include "config.h" #include "system.h" #include "coretypes.h" @@ -36,7 +32,6 @@ #include "toplev.h" #include "ggc.h" #include "target.h" -#include "expr.h" #include "tree-inline.h" #include "ada.h" @@ -600,18 +595,18 @@ gnat_to_gnu_entity (Entity_Id gnat_entit && DECL_NAME (TYPE_NAME (gnu_type)) == exception_data_name_id) gnu_type = except_type_node; - /* For a debug renaming declaration, build a pure debug entity. */ + /* For a debug renaming declaration, build a debug-only entity. */ if (Present (Debug_Renaming_Link (gnat_entity))) { - rtx addr; + /* Force a non-null value to make sure the symbol is retained. */ + tree value = build1 (INDIRECT_REF, gnu_type, + build1 (NOP_EXPR, + build_pointer_type (gnu_type), + integer_minus_one_node)); 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)); + SET_DECL_VALUE_EXPR (gnu_decl, value); + DECL_HAS_VALUE_EXPR_P (gnu_decl) = 1; gnat_pushdecl (gnu_decl, gnat_entity); break; } Index: gcc-interface/Make-lang.in =================================================================== --- gcc-interface/Make-lang.in (revision 162622) +++ gcc-interface/Make-lang.in (working copy) @@ -1235,8 +1235,8 @@ ada/cuintp.o : ada/gcc-interface/cuintp. $(COMPILER) -c $(ALL_COMPILERFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@ ada/decl.o : ada/gcc-interface/decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) $(FLAGS_H) toplev.h $(TARGET_H) $(EXPR_H) \ - $(TREE_INLINE_H) ada/gcc-interface/ada.h ada/types.h ada/atree.h \ + $(TM_H) $(TREE_H) $(FLAGS_H) toplev.h $(TARGET_H) $(TREE_INLINE_H) \ + ada/gcc-interface/ada.h ada/types.h ada/atree.h \ ada/elists.h ada/namet.h ada/nlists.h ada/repinfo.h ada/snames.h \ ada/stringt.h ada/uintp.h ada/fe.h ada/sinfo.h ada/einfo.h $(ADA_TREE_H) \ ada/gcc-interface/gigi.h gt-ada-decl.h