From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21535 invoked by alias); 8 Feb 2005 23:34:20 -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 21432 invoked by uid 48); 8 Feb 2005 23:34:09 -0000 Date: Wed, 09 Feb 2005 07:46:00 -0000 Message-ID: <20050208233409.21431.qmail@sourceware.org> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050208231758.19832.christophe.jaillet@wanadoo.fr> References: <20050208231758.19832.christophe.jaillet@wanadoo.fr> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/19832] don't remove an if when we know the value is the same as with the if (subtraction) X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg00591.txt.bz2 List-Id: ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-08 23:34 ------- Confirmed, here is the full testcase by the way: int f(int i, int j) { if (i!=j) return i - j; return 0; } Note I did not say the patch is useless but I just wantted to say that it would be useful if gcc did this for us instead of changing the code. Anyways this can be done with PHI-OPT, I will try to look into this doing this for 4.1. Your patch should be still considered. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |pinskia at gcc dot gnu dot | |org Severity|normal |enhancement Status|UNCONFIRMED |NEW Component|c |tree-optimization Ever Confirmed| |1 Keywords| |missed-optimization Last reconfirmed|0000-00-00 00:00:00 |2005-02-08 23:34:07 date| | Summary|Missed optimisation |don't remove an if when we | |know the value is the same | |as with the if (subtraction) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19832