From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3316 invoked by alias); 7 Feb 2005 06:45:30 -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 3093 invoked by uid 48); 7 Feb 2005 06:45:18 -0000 Date: Mon, 07 Feb 2005 19:36:00 -0000 Message-ID: <20050207064518.3084.qmail@sourceware.org> From: "kazu at cs dot umass dot edu" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050207032547.19804.kazu@cs.umass.edu> References: <20050207032547.19804.kazu@cs.umass.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/19804] Missed jump threading opportunity on "else" arm of COND_EXPR X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg00406.txt.bz2 List-Id: ------- Additional Comments From kazu at cs dot umass dot edu 2005-02-07 06:45 ------- Here is a test case where a jump threading opportunity would be missed if the change suggested in the original post were made: void foo (int *p) { if (*p != 0) bar (); if (*p != 0) bar (); } Here is a tree dump right before the first DOM. foo (p) { int D.1120; : D.1120_2 = *p_1; if (D.1120_2 != 0) goto ; else goto ; :; bar (); :; D.1120_3 = *p_1; if (D.1120_3 != 0) goto ; else goto ; :; bar (); :; return; } The change I suggested would record "D.1120_2 == 2" while following edge from to . Then th jump threading selection code figures out that D.1120_3 = *p_1; is the same as D.1120_3 = 0; via equality "D.1120_3 == D.1120_2". For whatever reason, the jump threading selection code does not want to see anything but SSA_NAME on the rhs. At that point, DOM throws away this jump threading opportunity. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19804