From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27482 invoked by alias); 7 Feb 2013 01:42:54 -0000 Received: (qmail 25672 invoked by uid 55); 7 Feb 2013 01:42:23 -0000 From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/47409] volatile struct member bug Date: Thu, 07 Feb 2013 01:42:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg00598.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47409 --- Comment #15 from joseph at codesourcery dot com 2013-02-07 01:42:21 UTC --- I think the most obvious way to handle volatile and unions for C would be to follow the handling of const (set C_TYPE_FIELDS_VOLATILE in the same way as C_TYPE_FIELDS_READONLY - that is, checking for fields whose types have C_TYPE_FIELDS_VOLATILE rather than just fields that are directly volatile - and use it to determine whether the struct or union is at least in part volatile for assignment). Though for unions the best you can do might be a copying loop; without knowing the active union member you can hardly respect access sizes for individual members, even if you wanted to.