From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25977 invoked by alias); 25 May 2007 10:22:11 -0000 Received: (qmail 25584 invoked by uid 48); 25 May 2007 10:21:40 -0000 Date: Fri, 25 May 2007 10:22:00 -0000 Message-ID: <20070525102140.25582.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/31981] Missed forw prop with indirect ref and addr. due to CCP In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth 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/msg02222.txt.bz2 ------- Comment #3 from rguenth at gcc dot gnu dot org 2007-05-25 11:21 ------- Indeed with -fno-tree-ccp the testcase is optimized by forwprop1 to : D.2000_3 = i_2(D) * 4; D.2001_4 = (int *) D.2000_3; D.2002_5 = &b.t[i_2(D)]; *D.2002_5 = 1; return; and then by forwprop2 to : D.2002_5 = &b.t[i_2(D)]; b.t[i_2(D)] = 1; return; so the right fix is to eventually teach CCP to do the first transformation, or rather teach fold_stmt to do a little tree combining in this case. Ugh. Or avoid this particular type of CCP. Ugh. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Missed forw prop with |Missed forw prop with |indirect ref and addr. |indirect ref and addr. due | |to CCP http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31981