From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14553 invoked by alias); 3 Jul 2005 04:55:15 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14529 invoked by uid 48); 3 Jul 2005 04:55:12 -0000 Date: Sun, 03 Jul 2005 04:55:00 -0000 Message-ID: <20050703045512.14527.qmail@sourceware.org> From: "gcc2eran at tromer dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050514140942.21568.rguenth@gcc.gnu.org> References: <20050514140942.21568.rguenth@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/21568] [4.0/4.1 regression] Casts in folding *& omitted X-Bugzilla-Reason: CC X-SW-Source: 2005-07/txt/msg00246.txt.bz2 List-Id: ------- Additional Comments From gcc2eran at tromer dot org 2005-07-03 04:55 ------- Why was this bug closed? The testcases in comment 5 do *not* pass. Here's the first testcase, fixed to compile cleanly: ---------------- int avail; int main() { volatile int **outside = (volatile int**)0x0123; *outside = &avail; // avail is now potentially modifiable externally to the program while (*(volatile int *)&avail == 0) continue; return 0; } ---------------- Following the reasoning of comment 5, the read in the loop must not be optimized away. Still, gcc 4.0.0 with -O3 produces this: ---------------- ... movl $avail, 291 movl avail, %eax testl %eax, %eax je .L5 xorl %eax, %eax leave ret .L5: jmp .L5 ---------------- -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21568