From patchwork Mon Nov 7 08:39:50 2022 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: 16307 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1920199wru; Mon, 7 Nov 2022 00:45:42 -0800 (PST) X-Google-Smtp-Source: AMsMyM7ywjKtYwYVy6e01YkMrRiBNT0EgHO3FdkS8NoKOPf2bPC2FVaiJhu/vC7+4ghlQW8pX70t X-Received: by 2002:a17:907:a2cf:b0:7ad:a693:abf8 with SMTP id re15-20020a170907a2cf00b007ada693abf8mr45337110ejc.137.1667810742072; Mon, 07 Nov 2022 00:45:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667810742; cv=none; d=google.com; s=arc-20160816; b=0YB6O2rPeObrK2+izWJYq5uMj98664xATRhLYVcNXa/XMm2VjKioJaKu4t7pHEYQyG ugw7hJfPLobhvktviTXrHykaUJzUkTioJeqIdlN3oHly+X7HvJxYjeinDaVCb+JXNkgb vOIpcHJ+BaaQCSge33LudiEe819f7kCwLu7v9BYfg3PoCP9s5l80RCdlEqSwOUY9IfcX b9xW2yp69DO8JrzhdQlXMdwcDHw1KlxV+jDK3JJnhE+03d10OwQZNhLzucRW5aGSfG7A 6RMtc5dvBi3faBYZer8JOV/+oj3EKh8iJ+FkL9rFq2aJ5Tgx6gE5LUH8Ko4ynuODoTkT Y0Vg== 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=ksfahuWL7eudxNAd6jio25lCssCJ5Zenoe5fZ4hV+zc=; b=LET61hP3cp1BUJAnNFTDsUk+M0q3xsbJkU3ivMYEzx3dMi4JySsiS3P8go2bgAG4uk 37EYKvYvctVIzpaaTZ1+1KJyicXItaIohHrq2LqAOVlk3ZEpZPj9/r6rRstMz5pjrLcH RyYcVW9L6gZojZaYNboq8jWetBqDPg/qda9cUzOL9VYkVEMnb0fnzLEY0mLdxJCdk1k+ avxaC3WfGKiurKC3Ra0Otxb5Xl/O3GHqDYv10C6HV4Xb7sBNdkGYIJjZYej74xKXb2WX Yjhfleg/2/fovf/nB++7Sv+tzvGAIceaEinIt6P58W7b1QhfoyS0Ci4Bq3fKpo0N7RUG KCmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="dxVVOBK/"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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. [8.43.85.97]) by mx.google.com with ESMTPS id ne39-20020a1709077ba700b0077b2e822b5dsi9655502ejc.674.2022.11.07.00.45.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 00:45:42 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="dxVVOBK/"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 5041F384B0D4 for ; Mon, 7 Nov 2022 08:42:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5041F384B0D4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667810564; bh=ksfahuWL7eudxNAd6jio25lCssCJ5Zenoe5fZ4hV+zc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=dxVVOBK/Ckz8lEe1XcragtopXzhMfVI7/MVJjK1l5di/Cbm98aaBjiquOIs61qY3P SNyDz6q1IA7LcOBeJrCCQsTBq7+bwgMfg4S5gCMN9FujGUL6fzzBigbyvJ+gzX6Dhd bvgYv5sg09akxcKEkjJnul7ItgsMJ75XFIFbhMtA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 2510C385841E for ; Mon, 7 Nov 2022 08:39:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2510C385841E Received: by mail-wr1-x434.google.com with SMTP id a14so15042775wru.5 for ; Mon, 07 Nov 2022 00:39:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ksfahuWL7eudxNAd6jio25lCssCJ5Zenoe5fZ4hV+zc=; b=OA+tp9w+XdxEDNZYm04rOpdWj5+2GCBu7VWB+LI1FYhvWXl0yVA2dOwxsr5062fmPh 1SIB6LVwoOB0xA7mdN3uhpxz6mCokDmbycqEqvX/mDIX9mW+kCSDkE9FuBZYvUKd1oS7 94pjdDfAT16Xc4unx6yvDJ7eiyCLfOohMO1KarQZALObTAaymZqvcdQpCCPVDoiYzlcN 59cwsHR/G3FD8a2MZzRg96jlTJi2WYC303nwD13XJ9HvrXN2Zw9gcSIT3nglG8+bZteH dLqpqic21QByUaOCHRjNp1RbqoLO3NGY6U/lFSm6bgD/HNOLDu7RwPMrlf0Mn02fd8w6 /yag== X-Gm-Message-State: ACrzQf3TxyqulTK4pJGJvL1UEjEarC5WUNSC+npo3D2ErRkCA2GeE0z1 jZaOL2PQtMdzIy6/0Fipfqr8K8Re5XIIIQ== X-Received: by 2002:adf:ec8b:0:b0:236:6f30:924f with SMTP id z11-20020adfec8b000000b002366f30924fmr30979377wrn.230.1667810392975; Mon, 07 Nov 2022 00:39:52 -0800 (PST) Received: from poulhies-Precision-5550.lan (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id n17-20020a5d6611000000b002383edcde09sm6630405wru.59.2022.11.07.00.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 00:39:52 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Steve Baird Subject: [COMMITTED] ada: Put_Image aspect spec incorrectly not inherited Date: Mon, 7 Nov 2022 09:39:50 +0100 Message-Id: <20221107083950.150721-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 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?1748826316463906995?= X-GMAIL-MSGID: =?utf-8?q?1748826316463906995?= From: Steve Baird In some cases, a Put_Image aspect specification for a scalar type was not correctly inherited by a descendant of that type. gcc/ada/ * exp_put_image.adb (Image_Should_Call_Put_Image): Correctly handle the case of an inherited Put_Image aspect specification for a scalar type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_put_image.adb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/ada/exp_put_image.adb b/gcc/ada/exp_put_image.adb index 50e0569a801..c489ad41fd1 100644 --- a/gcc/ada/exp_put_image.adb +++ b/gcc/ada/exp_put_image.adb @@ -1039,13 +1039,13 @@ package body Exp_Put_Image is end if; -- In Ada 2022, T'Image calls T'Put_Image if there is an explicit - -- aspect_specification for Put_Image, or if U_Type'Image is illegal - -- in pre-2022 versions of Ada. + -- (or inherited) aspect_specification for Put_Image, or if + -- U_Type'Image is illegal in pre-2022 versions of Ada. declare U_Type : constant Entity_Id := Underlying_Type (Entity (Prefix (N))); begin - if Present (TSS (U_Type, TSS_Put_Image)) then + if Present (Find_Aspect (U_Type, Aspect_Put_Image)) then return True; end if;