From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 7C8C73853C29 for ; Mon, 2 Aug 2021 12:34:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7C8C73853C29 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: t72ld9GOEsRTGJp23Tu5OErINXiDUUptQu7Y/6SzrcDCyQHxAFMQfd3SAc4Q/WKnDT/WKhZf0w 4hN/XG566RCbVYWwkfGTTRq+ULUff7Razcx7uwj1Ze8ajf+Z6KWkpDmJh5xfofn3j0mZc8l3+f 7zkymRYTTuCV+Lgq4GcZtDY2DZ2U4X4BvKIOltx3G7pal5s1lFFVeEtj2NABt1saKKro6aFC89 j69adWjvL2cLILLbubQdNfZMFyN5+KATTNu1p9cQaI2vNmT5Calgj3BL4Lsat9aWyQAW4u7jIo IgAAgHjcc6MbvF1r7mxAEghY X-IronPort-AV: E=Sophos;i="5.84,288,1620720000"; d="scan'208";a="64347913" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 02 Aug 2021 04:34:02 -0800 IronPort-SDR: nGerxxD0tHH2RjtbyLFbDrIpnMOKPG5WaUNGBGzoaGAGK6JTA+1gJPFsumT1PugU2wHNf7DyTy a6Wga7xHBFgN5ljQrUaXNqouQ7DNKnUDi3eOHK9Vl1DTWqdXlR7BiGaPz+n9hRiGWQCkmh7t7S M4zkuBinVMQswluCroBn5s8+kQYmhScM3HTZNUVgls+XxaNwPGlD897k4/JCNMxTeHLjRZUGEE HVPnYJ/Zj0+L0/7phhir1ppvInxwqe08GqHf53V57Wrl9XDXTnnuZEAVJcqSLxv9pbwpp1/oZ9 RDY= From: Thomas Schwinge To: Mark Wielaard , CC: , , Philip Herron Subject: Re: [PATCH 2/2] WIP union hir-lowering and type support In-Reply-To: References: <20210722231902.7401-1-mark@klomp.org> <20210722231902.7401-3-mark@klomp.org> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Mon, 2 Aug 2021 14:33:50 +0200 Message-ID: <874kc881qp.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 12:34:05 -0000 Hi! On 2021-08-02T00:37:37+0200, Mark Wielaard wrote: > On Sun, Aug 01, 2021 at 01:29:16PM +0200, Mark Wielaard wrote: >> I added two simple testcases to show the basic support for unions >> works now. But there are a couple of things that don't work correctly >> for unions yet. In particular when enabling warnings for the new >> union.rs testcase you'll get: >> >> $ gcc/gccrs -Bgcc -g union.rs >> union.rs:18:3: warning: field is never read: =E2=80=98f1=E2=80=99 >> 18 | f1: U, >> | ^ >> union.rs:19:3: warning: field is never read: =E2=80=98f2=E2=80=99 >> 19 | f2: V >> | ^ >> >> But those (union) fields in the struct are read. Similarly unused >> union fields aren't detected. > > This is why the testcase uses { dg-options "-w" } to suppress all > warnings. For that one, I've put in "Handle 'UnsafeBlockExpr' in liveness analysis". Hope I got that right; someone please review. > Attached is a small followup patch to resolve two FIXMEs to add the > correct locus for the Union variant fields (the actual fixme was fixed > by Thomas Young in commit 6d7b87f9dd92 "make struct field carry the > location info"). But it was missing TupleField and (obviously) > Union variants since those weren't implemented yet. > > Also on > https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=3Dtuple-union-fi= eld-locus For that one, Marc P. filed "Add locus to TupleField and pass it and union variants to HIR class". Gr=C3=BC=C3=9Fe thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955