From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 7FA843858D33 for ; Fri, 29 Dec 2023 15:57:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7FA843858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7FA843858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.129.153 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703865471; cv=none; b=hjn6Av/HcCwBtSIdV49VGgZ8WFK4Y97SoiAM+SMdH8teWH4uhS+KbOVKdeAExEKzdm3pSR1HfazeMQfFWLX362R/FpOCrTy20BkJ9WDo1TdUj9eBhB1vtl1mT23rcMDOzzojOVXnwuAGDSq9OKRv/mlaWrG+bUkqyPtzWSeFAlQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703865471; c=relaxed/simple; bh=OKCqIWkyd30OvRr73sHFMeP8GYzJ3R1cmcmgg4XV6Gs=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=Tn8U614sBMV47Qwc2yMbzelUPs4ONaiKVKST8H7NpNdWo8Q2x99PutuJRReYTqabWWlKpwm7g4tqf7C9BPqlo/kU3rVzZ/CHAwWk5gGJQEI2L9+M+8SeC6r2yzmuGSPX8Fu6gFgzZ/hykHrK85NBj9w0P/ukzbohIYGR8EvOByo= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: C7zx8p8dShGffHPt0CVCDQ== X-CSE-MsgGUID: ndtq7ReETteD6e4fwPRTRA== X-IronPort-AV: E=Sophos;i="6.04,315,1695715200"; d="scan'208";a="29957360" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 29 Dec 2023 07:57:48 -0800 IronPort-SDR: hcYQmbJxNsnbsZ9ugJNt0s3uz2oqKkT62w4vjzJwygnUkko/d+DG4wo8s47fBmyajectTE+jwf GMGThLqxmmp2383JptrlUuFRKpvFjJDdAgnTa8Dzr+xZmKZM6+dxfLOL8o+RRvzqp34/JMVkBF UfXVZk/2UqI7tmPmCXbM7LkxZ1FGhHLT94oQfeu9qCDeBGTRnM9dZdNSb3Yz5kk0YN86GAoNdJ z63Xqsf7g9XeItnSBxCdUDE2egN/zzSB11qjVejHnqqwjbql/DwhXDgznpN1mSEjvJec7g0dRA R1E= Date: Fri, 29 Dec 2023 15:57:44 +0000 From: Joseph Myers To: Martin Uecker CC: , "Jiang, Haochen" Subject: Re: [C PATCH] C: Fix type compatibility for structs with variable sized fields. In-Reply-To: <8ec71de2b1c42f2ed75a97cabced6561861791ab.camel@tugraz.at> Message-ID: References: <02a9b94e4d653b6f1b9f89a1b62187f46e871738.camel@tugraz.at> <8ec71de2b1c42f2ed75a97cabced6561861791ab.camel@tugraz.at> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3102.5 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, 27 Dec 2023, Martin Uecker wrote: > This patch hopefully fixes the test failure we see with gnu23-tag-4.c. > It does for me locally with -march=native (which otherwise reproduces > the problem). > > Bootstrapped and regession tested on x86_64 > > > C: Fix type compatibility for structs with variable sized fields. > > This fixes the test gcc.dg/gnu23-tag-4.c introduced by commit 23fee88f > which fails for -march=... because the DECL_FIELD_BIT_OFFSET are set > inconsistently for types with and without variable-sized field. This > is fixed by testing for DECL_ALIGN instead. The code is further > simplified by removing some unnecessary conditions, i.e. anon_field is > set unconditionaly and all fields are assumed to be DECL_FIELDs. > > gcc/c: > * c-typeck.c (tagged_types_tu_compatible_p): Revise. > > gcc/testsuite: > * gcc.dg./c23-tag-9.c: New test. OK. -- Joseph S. Myers joseph@codesourcery.com