From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8085 invoked by alias); 12 Dec 2004 17:42:07 -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 8032 invoked by uid 48); 12 Dec 2004 17:42:01 -0000 Date: Sun, 12 Dec 2004 17:42:00 -0000 Message-ID: <20041212174201.8031.qmail@sourceware.org> From: "kazu at cs dot umass dot edu" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041120062915.18576.pinskia@gcc.gnu.org> References: <20041120062915.18576.pinskia@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/18576] [3.4/4.0 Regression] missing jump threading because of type changes X-Bugzilla-Reason: CC X-SW-Source: 2004-12/txt/msg01669.txt.bz2 List-Id: ------- Additional Comments From kazu at cs dot umass dot edu 2004-12-12 17:42 ------- Another (possibly expensive) approach would be to "ignore" statements whose results are used only in the basic block we are threading through. Consider: # iftmp.0_1 = PHI <1(2), 0(3), 0(1)>; :; D.1171_13 = (unsigned char) iftmp.0_1; D.1160_14 = (int) D.1171_13; D.1145_16 = (unsigned char) D.1160_14; if (D.1145_16 != 0) goto ; else goto ; Note that the LHS of all MODIFY_EXPRs are used only in this basic block. So if we get to COND_EXPR and find out that COND_EXPR_COND is a constant (due to temporary propagation), then we can safely duplicate this basic block and thread an incoming edge (without causing code bloat). All the duplicate copies of MODIFY_EXPRs will be removed as dead code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18576