From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19478 invoked by alias); 17 May 2007 22:49:19 -0000 Received: (qmail 19440 invoked by uid 48); 17 May 2007 22:49:06 -0000 Date: Thu, 17 May 2007 22:49:00 -0000 Subject: [Bug tree-optimization/31981] New: Missed forw prop with indirect ref and addr. X-Bugzilla-Reason: CC Message-ID: 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-05/txt/msg01356.txt.bz2 This testcase should pass: /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-forwprop" } */ /* We should be able to optimize this to b.t[i] = 1 during early optimizations. */ struct a { int t[10]; }; struct a b; void f(__SIZE_TYPE__ i) { int *c = b.t; c[i] = 1; } /* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" { xfail *-*-* } } } */ /* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop2" } } */ /* { dg-final { cleanup-tree-dump "forwprop?" } } */ --------- I found this while fixing up forwprop for the pointer plus branch. -- Summary: Missed forw prop with indirect ref and addr. Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31981