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: 99341 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp291248vqr; Fri, 26 May 2023 00:42:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jR39SQ6irTEUVR4d81oIziPD4tzC0DvhZPswj8Gj8R9vVtno6hLlsLB2kToCzXXmVCx+P X-Received: by 2002:a17:907:d8c:b0:94e:d951:d4e7 with SMTP id go12-20020a1709070d8c00b0094ed951d4e7mr1294045ejc.59.1685086960501; Fri, 26 May 2023 00:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685086960; cv=none; d=google.com; s=arc-20160816; b=t5Zubj9baQkDtiMF31Qyvh1JBAAgs0bRjxeUzGLI6Vq1wMsyPJ9Ba0wZ2N2+/dEpjL C+B0p94o1IW7nDW3EUS+0WnS/5UebSvYGT+xAqdrCQFCRfOaq7TNM3jLY43M05LFO2ce MDUjB6R+FSma0iAkHt7dM/WDWHoOXFq8o8XuYSbqGdf4uWEV2KNLQanqCklZ5nYzPWrN 4+yLxYY/lz8n8cj6E0EadGyeG4WQLEV+gkP6cF3MTUV6/Fi8LsrWlsDkYDFUr8t7P02J W64uQxN0fBPRV+VoAjsriUH2DnzvRofnLNTrgUN25wjVuJUZa7fZx50cPU1quWWzmS6k GZtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=gfIAKgsY4teWlnIzsumtA1hFlHzC1Cs5TAjtksk1QLs=; b=AVvK8rivhiFJHAEVoqeWu8uy2YSQFt6xl+QoeVERBxFA11iYKjZl2DGCzddUpwGlv1 oPLXju5fn3X/aKzV4S2/ib5r4ZdBbg6tbGZOdK5umVskHg/ET6tT0kerhl1EJnqjWqXu ii1M/h0izUrbxuU0F2Mm7T6+kGMQ5cZ/g9jNqq8Ytv9x4fdmS3NTGwZZSNsx+39DklHP FQw19ORR3W0emFIN9bqEVYzbFokE4JRi+dKctJ5Oa8etUKVVvRZ7bVBKyPIaJ+k5qi6V xXWkLOIIXVjJLNlyeUGqjlVyiol73caaPOakDcPItwjFrB6/Q7aTsVqypSC9bnCaQgWX iKeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=h4MhXnco; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id og28-20020a1709071ddc00b009333705a9edsi581189ejc.746.2023.05.26.00.42.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 00:42:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=h4MhXnco; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F56E38A1403 for ; Fri, 26 May 2023 07:38:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F56E38A1403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685086739; bh=gfIAKgsY4teWlnIzsumtA1hFlHzC1Cs5TAjtksk1QLs=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=h4MhXncoUAn/dELzKABmrVPxWvwAj1e8Tb4kt+zJXDUoj8PXoBroZTiIKHmZVrxrR fg7Tp2FxZ95dvsEkrxS3yTJJlBjcMLu3oDd06BI1H+2Brlo6iFYPlf8XEHo9gpGtqU QfQLVHbbNiboDTFsFprxr8qvlPYKZ705IuzA5A1c= 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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766941744463837158?= X-GMAIL-MSGID: =?utf-8?q?1766941744463837158?= 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);