From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8015 invoked by alias); 29 May 2013 21:14:34 -0000 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 Received: (qmail 7971 invoked by uid 48); 29 May 2013 21:14:31 -0000 From: "dhazeghi at yahoo dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/57359] wrong code for union access at -O3 on x86_64-linux Date: Wed, 29 May 2013 21:14:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dhazeghi at yahoo dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-05/txt/msg02064.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57359 --- Comment #5 from Dara Hazeghi --- Sorry to ask again on this, but after re-reading, I'm not sure I understand the type-punning argument here: **ppll = ll; // write to u.ll *k = 0; // write to u.i j = *ppa; // u not touched ia[0][0] = *j; // u not touched printf("%d\n", u.i); // read from u.i >>From what I can tell, this is in fact reading the last member written to (so not falling under the unspecified behaviors listed in annex J / 6.2.6.1). Perhaps there is an additional restriction I am missing?