From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 4A7A53857C4F for ; Tue, 15 Jun 2021 15:51:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A7A53857C4F Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-264-GG1T8nvvMImMBP18lGbUkg-1; Tue, 15 Jun 2021 11:51:22 -0400 X-MC-Unique: GG1T8nvvMImMBP18lGbUkg-1 Received: by mail-qv1-f72.google.com with SMTP id i16-20020a0cf4900000b029022023514900so25928626qvm.11 for ; Tue, 15 Jun 2021 08:51:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=S2jb/c23Db6JpJBx/OV0c401oW/mrCVqbAAaWtzjns4=; b=k8WqoaPwLeUkDsXXJ92l8bkv/ya0PzmtWzHeTDkp/gEtIDuKcKmh7xcWNmtOCU/2pw TT+0cF36RZ7Gsz3DCQSkmtZl2Uqv0rby9xRM3ScQmMECWw5cBSn3DyCXnlnBoVLQ8p82 GbT55ob5/QZzo+uOsnjWcQpOqcc0ZEczlAAE2C2DPJSKncvn6UJ2x+uvrOVRRgL8vvST VCRq8eblTKTD18sGxyk6AyIKRovAYBNB+pOapHGsVdfZ4+6MGdNfCLXH1uBH161sEZWX 8AGsDyVIQsNqB3nK2FbUOf8axcPVYfUZWv2sLa6Hc++6khCIk5K35oH5cO67+bTZJDEM PbAg== X-Gm-Message-State: AOAM530jlZfVUDbMWCyv9SRn21naU8ddr9FlitYi2G8+wFuRZFecYvV2 ny6zxDN5rSChHTikHHhgzJiSy3uYK9V60oRtDEPFRt5vkjX+pior5BXHzZ7/VVqaVkOVL6+tirF xnGRECLngHo6YrYc0sQ== X-Received: by 2002:a05:622a:4a:: with SMTP id y10mr282591qtw.294.1623772282401; Tue, 15 Jun 2021 08:51:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5JZIBCiRVA2ws35fD4LQIYtgNMy9oWYiWdWfh6j2nIAkPlnCNEWM1Upo3OUyHVbWDCTRnuw== X-Received: by 2002:a05:622a:4a:: with SMTP id y10mr282566qtw.294.1623772282076; Tue, 15 Jun 2021 08:51:22 -0700 (PDT) Received: from [192.168.1.148] ([130.44.159.43]) by smtp.gmail.com with ESMTPSA id 137sm1240521qkg.75.2021.06.15.08.51.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Jun 2021 08:51:21 -0700 (PDT) Subject: Re: [PATCH] Add gnu::diagnose_as attribute To: Matthias Kretz , gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, David Malcolm , Jonathan Wakely References: <14205410.xuKvIAzr1H@excalibur> <14231752.kytX9F1ty5@excalibur> <2132675.qKCeTcHjAi@excalibur> From: Jason Merrill Message-ID: <9926a8f5-5513-11eb-75a2-ef405e14ff1a@redhat.com> Date: Tue, 15 Jun 2021 11:51:20 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <2132675.qKCeTcHjAi@excalibur> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Tue, 15 Jun 2021 15:51:27 -0000 On 6/11/21 6:01 AM, Matthias Kretz wrote: > How can we make progress here? I could try to produce some "Tony Tables" of > diagnostic output of my modified stdx::simd. I believe it's a major > productivity boost to see abbreviated / "obfuscated" diagnostics *out-of-the > box* (with the possibility to opt-out). Actually, it already *is* a > productivity boost to me. Understanding diagnostics has improved from > > "1. ooof, I'm not going to read this, let me rather guess what the issue was > 2. sh** I have to read it > 3. several minutes later: I finally found the five words to understand the > problem; I could use a break" > > to > > "1. right, let me check that" That's great. > For reference I'll attach my stdx::simd diagnose_as patch. > > We could also talk about extending the feature to provide more information > about the diagnose_as substition. E.g. print a list of all diagnose_as > substitutions, which were used, at the end of the output stream. Or simpler, > print "note: some identifiers were simplified, use -fno-diagnostics-use- > aliases to see their real names". Or perhaps before the first use of a name that doesn't correspond to a source-level name. > On Tuesday, 1 June 2021 21:12:18 CEST Jason Merrill wrote: >>> Right, but then two of my design goals can't be met: >>> >>> 1. Diagnostics have an improved signal-to-noise ratio out of the box. >>> >>> 2. We can use replacement names that are not valid identifiers. >> >> This is the basic disconnect: I think that these goals are >> contradictory, and that replacement names that are not valid identifiers >> will just confuse users that don't know about them. >> >> If a user sees stdx::foo in a diagnostic and then tries to refer to >> stdx::foo and gets an error, the diagnostic is not more helpful than one >> that uses the fully qualified name. >> >> Jonathan, David, any thoughts on this issue? > -struct _Scalar; > + struct [[__gnu__::__diagnose_as__("scalar")]] _Scalar; > template > - struct _Fixed; > + struct [[__gnu__::__diagnose_as__("fixed_size")]] _Fixed; Thes two could be the variant of the attribute without an explicit string, attached to the alias-declaration. > +using __sse [[__gnu__::__diagnose_as__("[SSE]")]] = _VecBuiltin<16>; > +using __avx [[__gnu__::__diagnose_as__("[AVX]")]] = _VecBuiltin<32>; > +using __avx512 [[__gnu__::__diagnose_as__("[AVX512]")]] = _VecBltnBtmsk<64>; > + using __odr_helper [[__gnu__::__diagnose_as__("[ODR helper]")]] These [] names seem like minimal improvements over the __ names that you would get from the attribute without an explicit string. > + inline namespace parallelism_v2 [[__gnu__::__diagnose_as__("std\u2093")]] { This could go on std::experimental itself, along with my proposed change to hide inline namespaces by default (with a note similar to the one above). Jason