From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21547 invoked by alias); 11 Aug 2005 15:20:25 -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 21527 invoked by uid 48); 11 Aug 2005 15:20:15 -0000 Date: Thu, 11 Aug 2005 15:20:00 -0000 From: "rguenth at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20050811152012.23326.rguenth@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop X-Bugzilla-Reason: CC X-SW-Source: 2005-08/txt/msg01224.txt.bz2 List-Id: The following testcase reduced from Kopete is miscompiled at -O2 struct Bar { bool is() const; int status() const; }; void foobar(void); void foobar2(void); void Foo(const Bar& x, const Bar& y) { const bool wasOffline = !x.is(); const bool isOffline = !y.is(); if (wasOffline || y.status() == 10) foobar(); if (wasOffline != isOffline) foobar2(); } .t23.mergephi: : D.1589_3 = is (x_2); wasOffline_4 = !D.1589_3; D.1590_6 = is (y_5); isOffline_7 = !D.1590_6; if (wasOffline_4) goto ; else goto ; :; D.1596_10 = status (y_5); if (D.1596_10 == 10) goto ; else goto ; :; foobar (); :; if (wasOffline_4 != isOffline_7) goto ; else goto ; :; foobar2 (); :; return; .t24.forwprop: : D.1589_3 = is (x_2); D.1590_6 = is (y_5); isOffline_7 = !D.1590_6; if (D.1589_3 == 0) goto ; else goto ; :; D.1596_10 = status (y_5); if (D.1596_10 == 10) goto ; else goto ; :; foobar (); :; if (D.1589_3 != 0) goto ; else goto ; :; foobar2 (); :; return; note that the comparison preceding foobar2() is hosed now, we even don't use isOffline or D.1590 anymore. -- Summary: [4.0 Regression] Wrong code from forwprop Product: gcc Version: 4.0.2 Status: UNCONFIRMED Keywords: wrong-code Severity: critical Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org,matz at suse dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326