From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17024 invoked by alias); 18 Oct 2008 18:30:55 -0000 Received: (qmail 15690 invoked by uid 48); 18 Oct 2008 18:29:32 -0000 Date: Sat, 18 Oct 2008 18:30:00 -0000 Message-ID: <20081018182932.15689.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/37868] code that breaks TBAA is misoptimized even with -fno-strict-aliasing In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sabre at nondot dot org" 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: 2008-10/txt/msg01222.txt.bz2 ------- Comment #1 from sabre at nondot dot org 2008-10-18 18:29 ------- Here is the testcase. I should work with -fno-strict-aliasing: #include #include struct X { unsigned char pad : 4; uint64_t a : 64; uint64_t b : 60; } __attribute__((packed)); int main (void) { struct X x; uint64_t bad_bits; x.pad = 255; x.a = -1ULL; x.b = -1ULL; bad_bits = ((uint64_t)-1ULL) ^ *(1+(uint64_t *) &x); printf("bad bits: %llx\n", bad_bits); return bad_bits != 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37868