From: Thomas Schwinge <thomas@codesourcery.com>
To: Mark Wielaard <mark@klomp.org>, <gcc-rust@gcc.gnu.org>
Cc: <dkm@kataplop.net>, <wenzhang5800@gmail.com>,
Philip Herron <philip.herron@embecosm.com>
Subject: Re: [PATCH 2/2] WIP union hir-lowering and type support
Date: Mon, 2 Aug 2021 14:33:50 +0200 [thread overview]
Message-ID: <874kc881qp.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <YQciMeKNpCH+ZMsJ@wildebeest.org>
Hi!
On 2021-08-02T00:37:37+0200, Mark Wielaard <mark@klomp.org> 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: ‘f1’
>> 18 | f1: U,
>> | ^
>> union.rs:19:3: warning: field is never read: ‘f2’
>> 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 <https://github.com/Rust-GCC/gccrs/pull/604>
"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=tuple-union-field-locus
For that one, Marc P. filed <https://github.com/Rust-GCC/gccrs/pull/602>
"Add locus to TupleField and pass it and union variants to HIR class".
Grüße
thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
next prev parent reply other threads:[~2021-08-02 12:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-22 23:19 union support Mark Wielaard
2021-07-22 23:19 ` [PATCH 1/2] Better union support in the parser Mark Wielaard
2021-07-23 11:19 ` Philip Herron
2021-07-22 23:19 ` [PATCH 2/2] WIP union hir-lowering and type support Mark Wielaard
2021-07-23 11:19 ` Philip Herron
2021-08-01 11:29 ` Mark Wielaard
2021-08-01 22:37 ` Mark Wielaard
2021-08-02 12:33 ` Thomas Schwinge [this message]
2021-08-04 21:04 ` Mark Wielaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874kc881qp.fsf@euler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=dkm@kataplop.net \
--cc=gcc-rust@gcc.gnu.org \
--cc=mark@klomp.org \
--cc=philip.herron@embecosm.com \
--cc=wenzhang5800@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).