From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 305 invoked by alias); 29 Feb 2004 06:37: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 32759 invoked by uid 48); 29 Feb 2004 06:37:29 -0000 Date: Sun, 29 Feb 2004 06:37:00 -0000 Message-ID: <20040229063729.32758.qmail@sources.redhat.com> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040229062941.14341.pinskia@gcc.gnu.org> References: <20040229062941.14341.pinskia@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug optimization/14341] Missed comparision optimization (jump threading related) X-Bugzilla-Reason: CC X-SW-Source: 2004-02/txt/msg02772.txt.bz2 List-Id: ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-02-29 06:37 ------- This should be done on the tree-ssa with the jump threading code, as this code is done right: void f(int); int h(int, int); void t() { int i; int x; for( i = 0; i < 100000000; i++ ){ if (i < 100000000) f(1); else f(0); } } And this one: void t1() { int i; int x; for( i = 0; i < 100000000; i++ ){ int t; if (i < 100000000) t=1;else t =0; f( t ); } } But note this one is not either: void t() { int i; int x; for( i = 0; i < 100000000; i++ ){ int t = ({int i;if (i < 100000000) i=1;else i =0; i;}); f( t ); } } -- What |Removed |Added ---------------------------------------------------------------------------- CC| |law at gcc dot gnu dot org Keywords| |pessimizes-code Known to fail| |tree-ssa Summary|Missed optimization |Missed comparision | |optimization (jump threading | |related) Target Milestone|--- |tree-ssa http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14341