From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x434.google.com with SMTP id a14so15042775wru.5 for ; Mon, 07 Nov 2022 00:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ksfahuWL7eudxNAd6jio25lCssCJ5Zenoe5fZ4hV+zc=; b=Az9z4DQ0tfbOourYbmVmg/VCtOQ6BGeTyOBmZObGTAIUW/EMQPrhAd9KBSShUmHzj3 Hxi1fYMt79xkaSbYVCUVVRndQlSLaJoUzFAlljyKLW7CVIaBJZKELUlAi1JNf8dylkp/ PEdm1h7tPXFcZ3TQ0JY9tjjibYrzKZhxNJx2a3HCYqttrpcbrtbyv4NNpyH2jQYuZIVG uoaJMZmD1dYmXuEjyuEpeoBIIkcxnLlrTdSpYDI5N8qAry/5b7Ko9ZBNexzs5OIqxQ1r ZG92WgOvcT4nJ94ZfBfsCovtvMgKpFAQqUBNdGmP7KtiKmIW1gQM2nK/w3z0Kcz0rKUz 6oTw== 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-Google-Smtp-Source: AMsMyM5oW0VG0wPwRyfgE64anjylAHXIXx9kJdXL5wxmhjHiKoyA87ojd5hf+j8aVimDW2h2pBCIKw== 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) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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; -- 2.34.1