Message ID | 20230201143831.BDA3A20423@pchp3.se.axis.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp315032wrn; Wed, 1 Feb 2023 06:39:29 -0800 (PST) X-Google-Smtp-Source: AK7set8y/eVC2CbOg15ZG8q16BnbDv4wR1GlMmm4DMCJceFjHKXWwhxU7tN7sizm2PdGazxnnXVu X-Received: by 2002:a05:6402:500c:b0:49e:6bf1:5399 with SMTP id p12-20020a056402500c00b0049e6bf15399mr2432905eda.8.1675262369225; Wed, 01 Feb 2023 06:39:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675262369; cv=none; d=google.com; s=arc-20160816; b=Ad+6vhcwa1VrxccOE7y4G5fCNB6LGP83L7dPdDfo2ERQeE0alzbzASM4oOVDGo8r2g /ycsOECjM+6aefq8SpWl4yZZ6GMUI/VSsn1iUpzv/GPdiefzayUCM9IrdAJI6AbgYPPb y0xKvCvbk6VpmLb+pksrJSAWzX2JH3hEDcZiyBJCGdzzQKVXG/2sde+sIPb8bZ3FRQ+3 3giS0tfeKRPcoL2QQT5ujrz+Jz4V8ngWXy1hXj8Ar9SceuioeQ833YMsUVs54NTrWbDk 0DnxR9woYr6kEI/Ykvk2wcctrF9uNxwkuC+vKARurzteUaQLS5+8eE6L6obCqmSP/R7Q yq9Q== 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:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=15BjiSOxVKJcYbwT4VJRZPI/VY+jkkyNY1hTPaJwVJ4=; b=pEi0eodvg/6yW7RhqCXfzx4TxR2IyHGQsB43FIHz2y9xGVp7LjjxUtfM8wl4bXpg5f oYNKHQV0fjEHxXQeWbbw2pIE2ieDjzq43KCEt30If9XdT3CRK8dv+/n1WpCk+90nfySs KIw0mMrkBIX8JpNvd4ElSxQk9Q5niMZf3ziWGp2QEGULTh3OVXqUb24j2cV5ENXRWyEo GROmeE9zWq/qMzP0tKU/5mK+kMZdDltXtV4AvPuwm1xmFt0S8LyjJIQN1zzGKr3yAIfk x7xUqJFKo46CZVmQiYOcy18H+AvmzASboe0U8M3Hg+j4y8o/u/fHOLXQfV7/fG1Q14jK R7LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vbhTq+9n; 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 a22-20020aa7cf16000000b0049defeaec6dsi21075212edy.530.2023.02.01.06.39.29 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 06:39:29 -0800 (PST) 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=vbhTq+9n; 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 06CA638582BE for <ouuuleilei@gmail.com>; Wed, 1 Feb 2023 14:39:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06CA638582BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675262357; bh=15BjiSOxVKJcYbwT4VJRZPI/VY+jkkyNY1hTPaJwVJ4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vbhTq+9n2ZAW3Vx/66KUBgaaPG4jVbZWXAuso1PoN5iOxOeTLqUXAUeU8ob8vuJ3B Gk/gAryrQq43S0+yCrThNCugelTMikmE1b2IeavJdnED4CxDzhEcpm7Slaa5uiGsHr 5TO+nzgPxmwaiHPQtB+2xYtcSb+uiaF8m7OjRSmQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 5E6D13858C36; Wed, 1 Feb 2023 14:38:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E6D13858C36 To: <libstdc++@gcc.gnu.org>, <gcc-patches@gcc.gnu.org> Subject: [PATCH] libstdc++ testsuite: Correct S0 in std/time/hh_mm_ss/1.cc MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-ID: <20230201143831.BDA3A20423@pchp3.se.axis.com> Date: Wed, 1 Feb 2023 15:38:31 +0100 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Hans-Peter Nilsson via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Hans-Peter Nilsson <hp@axis.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756639913758756947?= X-GMAIL-MSGID: =?utf-8?q?1756639913758756947?= |
Series |
libstdc++ testsuite: Correct S0 in std/time/hh_mm_ss/1.cc
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Hans-Peter Nilsson
Feb. 1, 2023, 2:38 p.m. UTC
Tested cris-elf and native x86_64-pc-linux-gnu. Ok to commit? -----8< ------ For targets where the ABI mandates structure layout that has no padding, like cris-elf, this test started failing when introduced as an add-on to the existing 1.cc, thereby effectively causing a regression in testsuite results. Adding an empty structure to S0, corresponds better to the layout of hh_mm_ss<seconds>. PR testsuite/108632 * testsuite/std/time/hh_mm_ss/1.cc (size): Add empty struct at end of S0. --- libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, 1 Feb 2023 at 14:38, Hans-Peter Nilsson via Libstdc++ <libstdc++@gcc.gnu.org> wrote: > > Tested cris-elf and native x86_64-pc-linux-gnu. > Ok to commit? OK, thanks.
On Wed, 1 Feb 2023 at 16:01, Jonathan Wakely wrote: > > On Wed, 1 Feb 2023 at 14:38, Hans-Peter Nilsson via Libstdc++ > <libstdc++@gcc.gnu.org> wrote: > > > > Tested cris-elf and native x86_64-pc-linux-gnu. > > Ok to commit? > > OK, thanks. We could add the [[no_unique_address]] attribute to the _M_ss member, so that it takes no space when it's an empty struct. That would save a byte in hh_mm_ss for cris-elf and targets like that, but as this type isn't meant to be used for storage, I don't think we should bother. People shouldn't be using this as a data member, just creating it on the stack and then discarding it.
> From: Jonathan Wakely <jwakely@redhat.com> > Date: Wed, 1 Feb 2023 18:19:09 +0100 > On Wed, 1 Feb 2023 at 16:01, Jonathan Wakely wrote: > > > > On Wed, 1 Feb 2023 at 14:38, Hans-Peter Nilsson via Libstdc++ > > <libstdc++@gcc.gnu.org> wrote: > > > > > > Tested cris-elf and native x86_64-pc-linux-gnu. > > > Ok to commit? > > > > OK, thanks. > > We could add the [[no_unique_address]] attribute to the _M_ss member, > so that it takes no space when it's an empty struct. > > That would save a byte in hh_mm_ss for cris-elf and targets like that, > but as this type isn't meant to be used for storage, I don't think we > should bother. People shouldn't be using this as a data member, just > creating it on the stack and then discarding it. > Agreed; no worries. Thanks for the review. brgds, H-P
diff --git a/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc b/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc index d97a9057f472..26a4555576c8 100644 --- a/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc +++ b/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc @@ -103,7 +103,7 @@ size() { using namespace std::chrono; - struct S0 { long long h; char m; char s; bool neg; }; + struct S0 { long long h; char m; char s; bool neg; struct { } empty; }; static_assert(sizeof(hh_mm_ss<seconds>) == sizeof(S0)); struct S1 { long long h; char m; char s; bool neg; char ss; }; static_assert(sizeof(hh_mm_ss<duration<int, std::centi>>) == sizeof(S1));