From patchwork Fri May 26 07:36:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 70124 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D6353898C73 for ; Fri, 26 May 2023 07:38:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D6353898C73 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685086723; bh=gfIAKgsY4teWlnIzsumtA1hFlHzC1Cs5TAjtksk1QLs=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=vhoXtLZX2pXCUsRMvIaKnFy08cei4QM/EB7EUswwZYh0A1TncA0cWGhdo6/rGMZFa PyO5N5wU1csxyGAUXPiKaTmB3BV56Ky8nRl5QIfmMJ0+GsGRo+yLLgLKy4zrHHN86H gcvNQ/QvxfRGbenl8yMfN6dSqWecakqfKr8fDNyE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 19BA73856DE6 for ; Fri, 26 May 2023 07:36:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19BA73856DE6 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-30aa76048fbso201161f8f.2 for ; Fri, 26 May 2023 00:36:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685086563; x=1687678563; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gfIAKgsY4teWlnIzsumtA1hFlHzC1Cs5TAjtksk1QLs=; b=TGCE0ELAgpVWtjqgpXbVj/q4cLEYXbPvWw3VIB2a/GCg3+Jw2+1gtKt49TC3SWMGIF WaZQPgA3SwAgffGs+s4bIoSQNeErj+oLbfU2J9t2W6onLzc+jgwEACvbIq0l1S1vW24g pOASqy2DJdSxZdZf9XP/NMzzAHwhe3Y2+cSb3KdN4/1+mRHzZdIoFlpVGi18JicruGYZ hLoC4d+pKDjvhZ/p5P96EXmAjvhmtv4LTFmPcmbrNXMTxopoN7l9C1tKGtFtPq5RSSsq Un62UuDnd3CVsVwHYCHKYVmVAc2wzIU3xJ7gqD/5haIPFez040B9FXIH6e2YTtB7jOFT 1apw== X-Gm-Message-State: AC+VfDxHNUK1AcBA0swx6Qrkxz/7q1XGg7RzuTlZWUlNlD9uk7EmTJuV eNlQZtFCXnvcq3cMITSZ8t1qb9m2UYwnj+MDVeYKhQ== X-Google-Smtp-Source: ACHHUZ5x9xq1FNz6bSipz5MEgKMrG11/e802Fx9jZ9sJZ2AfZcGVxmG273x90R3n+psGEyVHR0FhMQ== X-Received: by 2002:adf:e9c3:0:b0:309:475c:c90e with SMTP id l3-20020adfe9c3000000b00309475cc90emr692401wrn.37.1685086563706; Fri, 26 May 2023 00:36:03 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:777b:eef4:6f79:f26f]) by smtp.gmail.com with ESMTPSA id a13-20020adffacd000000b003064600cff9sm4208218wrs.38.2023.05.26.00.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 00:36:03 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Remove Is_Descendant_Of_Address flag from Standard_Address Date: Fri, 26 May 2023 09:36:01 +0200 Message-Id: <20230526073601.2068384-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Eric Botcazou It breaks the Allow_Integer_Address special mode. Add new standard_address parameters to gigi and alphabetize others, this is necessary when addresses are not treated like integers. gcc/ada/ * back_end.adb (Call_Back_End): Add gigi_standard_address to the signature of the gigi procedure and alphabetize other parameters. Pass Standard_Address as actual parameter for it. * cstand.adb (Create_Standard): Do not set Is_Descendant_Of_Address on Standard_Address. * gcc-interface/gigi.h (gigi): Add a standard_address parameter and alphabetize others. * gcc-interface/trans.cc (gigi): Likewise. Record a builtin address type and save it as the type for Standard.Address. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/back_end.adb | 10 ++++++---- gcc/ada/cstand.adb | 2 -- gcc/ada/gcc-interface/gigi.h | 5 +++-- gcc/ada/gcc-interface/trans.cc | 16 +++++++++++----- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb index 23f5abe955e..bc370e9e9c7 100644 --- a/gcc/ada/back_end.adb +++ b/gcc/ada/back_end.adb @@ -103,11 +103,12 @@ package body Back_End is number_file : Nat; file_info_ptr : Address; + gigi_standard_address : Entity_Id; gigi_standard_boolean : Entity_Id; - gigi_standard_integer : Entity_Id; gigi_standard_character : Entity_Id; - gigi_standard_long_long_float : Entity_Id; gigi_standard_exception_type : Entity_Id; + gigi_standard_integer : Entity_Id; + gigi_standard_long_long_float : Entity_Id; gigi_operating_mode : Back_End_Mode_Type); pragma Import (C, gigi); @@ -171,11 +172,12 @@ package body Back_End is number_file => Num_Source_Files, file_info_ptr => File_Info_Array'Address, + gigi_standard_address => Standard_Address, gigi_standard_boolean => Standard_Boolean, - gigi_standard_integer => Standard_Integer, gigi_standard_character => Standard_Character, - gigi_standard_long_long_float => Standard_Long_Long_Float, gigi_standard_exception_type => Standard_Exception_Type, + gigi_standard_integer => Standard_Integer, + gigi_standard_long_long_float => Standard_Long_Long_Float, gigi_operating_mode => Mode); end Call_Back_End; diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb index d4a420deda9..fbd5888b198 100644 --- a/gcc/ada/cstand.adb +++ b/gcc/ada/cstand.adb @@ -1370,11 +1370,9 @@ package body CStand is -- Standard_Address is not user visible, but is used internally. It is -- an unsigned type mod 2**System_Address_Size with System.Address size. - -- We flag it as Is_Descendant_Of_Address for code generation purposes. Standard_Address := New_Standard_Entity ("standard_address"); Build_Unsigned_Integer_Type (Standard_Address, System_Address_Size); - Set_Is_Descendant_Of_Address (Standard_Address); -- Note: universal integer and universal real are constructed as fully -- formed signed numeric types, with parameters corresponding to the diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index fee0450a338..ec85ce44bc3 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -245,11 +245,12 @@ extern void gigi (Node_Id gnat_root, struct List_Header *list_headers_ptr, Nat number_file, struct File_Info_Type *file_info_ptr, + Entity_Id standard_address, Entity_Id standard_boolean, - Entity_Id standard_integer, Entity_Id standard_character, - Entity_Id standard_long_long_float, Entity_Id standard_exception_type, + Entity_Id standard_integer, + Entity_Id standard_long_long_float, Int gigi_operating_mode); #ifdef __cplusplus diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index c26f1b6e1ac..13f438c424b 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -290,11 +290,12 @@ gigi (Node_Id gnat_root, struct List_Header *list_headers_ptr, Nat number_file, struct File_Info_Type *file_info_ptr, + Entity_Id standard_address, Entity_Id standard_boolean, - Entity_Id standard_integer, Entity_Id standard_character, - Entity_Id standard_long_long_float, Entity_Id standard_exception_type, + Entity_Id standard_integer, + Entity_Id standard_long_long_float, Int gigi_operating_mode) { Node_Id gnat_iter; @@ -375,14 +376,19 @@ gigi (Node_Id gnat_root, double_float_alignment = get_target_double_float_alignment (); double_scalar_alignment = get_target_double_scalar_alignment (); - /* Record the builtin types. Define `integer' and `character' first so that - dbx will output them first. */ + /* Record the builtin types. */ + record_builtin_type ("address", pointer_sized_int_node, false); record_builtin_type ("integer", integer_type_node, false); record_builtin_type ("character", char_type_node, false); record_builtin_type ("boolean", boolean_type_node, false); record_builtin_type ("void", void_type_node, false); - /* Save the type we made for integer as the type for Standard.Integer. */ + /* Save the type we made for address as the type for Standard.Address. */ + save_gnu_tree (Base_Type (standard_address), + TYPE_NAME (pointer_sized_int_node), + false); + + /* Likewise for integer as the type for Standard.Integer. */ save_gnu_tree (Base_Type (standard_integer), TYPE_NAME (integer_type_node), false);