From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 643B83857434; Wed, 6 Apr 2022 15:58:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 643B83857434 Received: by mail-wr1-x429.google.com with SMTP id c7so3993764wrd.0; Wed, 06 Apr 2022 08:58:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V1CuoaZ/O9Ba8xaXbGZmaiai/w2FsXobD6ImdebfsC4=; b=b3cF1aP6BPQmB7JcGNFK4ZFwR1GNMLXrfelEJLF8LY/H1aJnrnyDgct8d2tmGGCXjI bQSOc7Hg7y4F0iw1l+1brFeq7q25uEabw9t+SlRMpxspuHTWI/pjrxXVGPUJROO+cWzG 05x0jkYkH23uPWSMQhYQ/XLLSRBM/cFnBtqeo015+r/esKergox/BQcjcHzb3RWYz+vT aK0y1iMgwGcMQKBOsiYGyKsZdZxe12o0GXYtHLFYyqf27BzASomr+0VbFK6tR1OG1oKB 6cKNR4xa6QNKp0AaNuEm8Jp+976ULb4tqNroqKHsCR9qSrhU18fJewcaRH5RC+RyIXxp ROnw== X-Gm-Message-State: AOAM532SZ2QUaTkDDAdMJgI5aFmrmSkHoaNsdaDXBONC1DjU5qTvbALt 3Zv06ZUme3x1ZMI/f2+jRcD9Mb5b6yIGttcphu5+4enB X-Google-Smtp-Source: ABdhPJwZ9UQ1fcVxcfpP1GMQVatf9Rbmmo/OIKZzrwsKpRMnEqItdCKFXZ2nEcv4m/V7Yy/luIeKzm3zLtL+cr7wK5w= X-Received: by 2002:a5d:5482:0:b0:206:b5c:ef4d with SMTP id h2-20020a5d5482000000b002060b5cef4dmr7053958wrv.152.1649260690957; Wed, 06 Apr 2022 08:58:10 -0700 (PDT) MIME-Version: 1.0 References: <20220405164329.99C9F20426@pchp3.se.axis.com> <20220406144234.781D92042B@pchp3.se.axis.com> In-Reply-To: <20220406144234.781D92042B@pchp3.se.axis.com> From: Jonathan Wakely Date: Wed, 6 Apr 2022 16:57:58 +0100 Message-ID: Subject: Re: [PATCH] libstdc++-v3 expected: Don't test ABI-variant properties in requirements.cc To: Hans-Peter Nilsson Cc: gcc-patches , "libstdc++" X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2022 15:58:14 -0000 Thanks! On Wed, 6 Apr 2022, 15:42 Hans-Peter Nilsson, wrote: > > From: Jonathan Wakely > > Date: Tue, 5 Apr 2022 20:47:58 +0200 > > > On Tue, 5 Apr 2022, 17:44 Hans-Peter Nilsson via > > Libstdc++, > > > > > wrote: > > Ok to commit? > > -------------- 8< -------------- > > > > Without this, for a target where alignment and structure-sizes are by > > default byte-aligned, such as cris-elf, you'll see, in libstdc++.log: > > > > /X/gcc/libstdc++-v3/testsuite/20_util/expected/requirements.cc:127: > error: static assertion failed > > /X/gcc/libstdc++-v3/testsuite/20_util/expected/requirements.cc:127: > note: the comparison reduces to '(5 == 2)' > > compiler exited with status 1 > > FAIL: 20_util/expected/requirements.cc (test for excess errors) > > Excess errors: > > /X/gcc/libstdc++-v3/testsuite/20_util/expected/requirements.cc:127: > error: static assertion failed > > > > It seems the intent is a smoke-test and that conditionals for ABI > > properties are out of scope, so best to just delete this particular > > line. > > > > The idea is to ensure the object is no larger than necessary. > > > > I think we could use == sizeof(void*)+alignof(void*) which > > would be correct everywhere. Does that work for cris-elf? > > Oh right, yes it does. Ok then, I'll commit this: > > -------------- 8< -------------- > > [PATCH v2] libstdc++-v3 expected: Correct minimal-size test in > requirements.cc > > Without this, for a target where alignment and structure-sizes are by > default byte-aligned, such as cris-elf, you'll see, in libstdc++.log: > > /X/gcc/libstdc++-v3/testsuite/20_util/expected/requirements.cc:127: error: > static assertion failed > /X/gcc/libstdc++-v3/testsuite/20_util/expected/requirements.cc:127: note: > the comparison reduces to '(5 == 2)' > compiler exited with status 1 > FAIL: 20_util/expected/requirements.cc (test for excess errors) > Excess errors: > /X/gcc/libstdc++-v3/testsuite/20_util/expected/requirements.cc:127: error: > static assertion failed > > The intent of that line is to check that the object is not larger than > necessary. > > libstdc++-v3/: > * testsuite/20_util/expected/requirements.cc: Correct minimal-size > test. > > --- > libstdc++-v3/testsuite/20_util/expected/requirements.cc | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/libstdc++-v3/testsuite/20_util/expected/requirements.cc > b/libstdc++-v3/testsuite/20_util/expected/requirements.cc > index 485aa338679c..a51a007a4fc3 100644 > --- a/libstdc++-v3/testsuite/20_util/expected/requirements.cc > +++ b/libstdc++-v3/testsuite/20_util/expected/requirements.cc > @@ -124,6 +124,6 @@ static_assert( move_assignable< void, G > ); > // QoI properties > static_assert( sizeof(std::expected) == 2 ); > static_assert( sizeof(std::expected) == 2 ); > -static_assert( sizeof(std::expected) == 2 * __alignof(void*) > ); > +static_assert( sizeof(std::expected) == sizeof(void*) + > __alignof(void*) ); > static_assert( alignof(std::expected) == 1 ); > static_assert( alignof(std::expected) == alignof(void*) ); > -- > 2.30.2 > >