From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24985 invoked by alias); 18 Dec 2005 19:06:26 -0000 Received: (qmail 24969 invoked by uid 48); 18 Dec 2005 19:06:24 -0000 Date: Sun, 18 Dec 2005 19:06:00 -0000 Subject: [Bug tree-optimization/25485] New: VRP misses an "if" statement that could be optimized away X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "kazu at gcc dot gnu dot org" 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 X-SW-Source: 2005-12/txt/msg01914.txt.bz2 List-Id: Consider: int foo (int a, int b) { if (a > 50) return 19; if (a > 63 && b < 50) return 17; return 31; } VRP does not optimize away the second "if" statement. Here is the output from VRP. foo (a, b) { _Bool D.1662; _Bool D.1661; _Bool D.1660; int D.1659; : if (a_2 > 50) goto ; else goto ; :; D.1660_4 = 0; D.1661_6 = b_5 <= 49; D.1662_7 = 0; if (D.1662_7) goto ; else goto ; :; # D.1659_1 = PHI <19(2), 17(4), 31(3)>; :; return D.1659_1; } -- Summary: VRP misses an "if" statement that could be optimized away Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kazu at gcc dot gnu dot org GCC target triplet: x86_64-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25485