From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8851 invoked by alias); 24 Apr 2012 10:48:03 -0000 Received: (qmail 8825 invoked by uid 22791); 24 Apr 2012 10:48:02 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Apr 2012 10:47:50 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/52979] [4.7/4.8 Regression] likely wrong code bug w/packed bitfields Date: Tue, 24 Apr 2012 10:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.1 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: 2012-04/txt/msg02113.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52979 --- Comment #4 from Jakub Jelinek 2012-04-24 10:47:04 UTC --- Doesn't apparently need a loop, the following fails on 4.7 branch and older trunk with -O2 -ftree-vectorize as well. The dummy foo function is important to reproduce it, apparently otherwise notice_global_symbol is called on a and creates DECL_RTL for it while it still has DECL_ALIGN 8. Later on vect_compute_data_ref_alignment increases the alignment of a to 128 and sets DECL_USER_ALIGN. extern void abort (void); int c, d, e; void foo (void) { } struct __attribute__((packed)) S { int g : 31; int h : 6; }; struct S a = { 1 }; static struct S b = { 1 }; void bar (void) { a.h = 1; struct S f = { }; b = f; e = 0; if (d) c = a.g; } void baz (void) { bar (); a = b; } int main () { baz (); if (a.g) abort (); return 0; }