From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15512 invoked by alias); 12 Mar 2007 15:09:34 -0000 Received: (qmail 15425 invoked by uid 48); 12 Mar 2007 15:09:17 -0000 Date: Mon, 12 Mar 2007 15:09:00 -0000 Message-ID: <20070312150917.15424.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/31146] forwprop does not look through casts In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu 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: 2007-03/txt/msg01059.txt.bz2 ------- Comment #2 from pinskia at gcc dot gnu dot org 2007-03-12 15:09 ------- I should mention, unless it can produce a constant result. For an example this function: void bar (void * a) { struct foo Foo; int i; for (i=0; i<3; ++i) { void *p = a; int *pi = (int *)p; if (pi != 0) { *pi = 0; } } } Should not be transformed into: void bar (void * a) { struct foo Foo; int i; for (i=0; i<3; ++i) { void *p = a; int *pi = (int *)p; if (p != 0) { *pi = 0; } } } As VRP is not as smart as there is no back tracking of ranges. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31146