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 ESMTPS id 1D8F03858C3A for ; Mon, 20 Mar 2023 10:15:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D8F03858C3A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679307339; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=y4wbHGWtrPc3o9XcMDEqftmsvvmCNzSW70zs3DCYj14=; b=DSPbZ4ZjdxWTqnRw6v6uBnNIpvA5YTn6a5ZmqCwRDGph7rK0SuXpbmGWfcwaGcEaBXoJqu p1g+q+NEv55EccFB+p8NxKUS1IR3UeyNvOATpRjIRXWw47me7FCjZtZldYGC/WyL6ggNAx dwAGB20TsguIMqfYkmF/88U2nz28YSE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-184-K350YVYxPq2Zpvv5CvWE_w-1; Mon, 20 Mar 2023 06:15:36 -0400 X-MC-Unique: K350YVYxPq2Zpvv5CvWE_w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4AB9E1C05EB3; Mon, 20 Mar 2023 10:15:36 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09ACB492C13; Mon, 20 Mar 2023 10:15:35 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 32KAFXaR3036517 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 20 Mar 2023 11:15:33 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 32KAFW2m3036516; Mon, 20 Mar 2023 11:15:32 +0100 Date: Mon, 20 Mar 2023 11:15:32 +0100 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] New testcase Message-ID: Reply-To: Jakub Jelinek References: <20230314072924.C1A34385840C@sourceware.org> MIME-Version: 1.0 In-Reply-To: <20230314072924.C1A34385840C@sourceware.org> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: On Tue, Mar 14, 2023 at 07:29:19AM +0000, Richard Biener via Gcc-patches wrote: > This is a reduced testcase for an issue I ran into when trying to > improve PTA compile-time further, there wasn't any C family runfail > in the testsuite for this. > > Pushed. > > * g++.dg/torture/20230313.C: New testcase. I've noticed this testcase FAILs on i686-linux with -fstack-protector-strong. sizeof (auto_vec) == 16, which in this case contains 4-byte m_vec (which points to to m_auto), then 8-byte m_auto which contains just 8-byte m_vecpfx and finally 1 byte m_data, rest is padding. We then try to push 2 ints to it, so 8 bytes, starting at the end of m_vecpfx aka address of m_data, but there is just 1 byte + 3 bytes of padding. In the lp64 case, I think sizeof (auto_vec) == 24, because there is 8-byte m_vec, 8-byte m_vecpfx and 1-byte m_char all with 8-byte alignment. Can we just change --- gcc/testsuite/g++.dg/torture/20230313.C.jj 2023-03-14 12:24:55.930723588 +0100 +++ gcc/testsuite/g++.dg/torture/20230313.C 2023-03-20 11:11:55.009044518 +0100 @@ -60,7 +60,7 @@ struct auto_vec : vec this->release (); } vec m_auto; - char m_data; + char m_data[2 * sizeof (int)]; }; template struct vec or does it go against what the testcase wants to verify? Or char m_data[__alignof (void *) == 2 * sizeof (int) ? 1 : 2 * sizeof (int)]; to make it work almost as is (just char[1] instead of char) for LP64 and use the exact size otherwise (ILP32, 128-bit pointers and the like)? Jakub