From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30800 invoked by alias); 6 Feb 2004 22:47: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 30791 invoked by uid 48); 6 Feb 2004 22:47:06 -0000 Date: Fri, 06 Feb 2004 22:47:00 -0000 From: "falk at debian dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040206224705.14052.falk@debian.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug optimization/14052] New: Combiner weakness X-Bugzilla-Reason: CC X-SW-Source: 2004-02/txt/msg00828.txt.bz2 List-Id: For this code: int f1(int x) { return x == 1 || x == 3; } int f2(int x) { return x == 1 || x == 3 || x == 1; } I get: 0000000000000000 : 0: a1 75 00 42 cmpeq a0,0x3,t0 4: a0 35 00 42 cmpeq a0,0x1,v0 8: 00 04 01 44 or v0,t0,v0 c: 01 80 fa 6b ret 0000000000000010 : 10: a0 35 00 42 cmpeq a0,0x1,v0 14: a2 75 00 42 cmpeq a0,0x3,t1 18: 01 04 02 44 or v0,t1,t0 1c: a0 03 e0 43 cmpult zero,v0,v0 20: c0 34 20 44 cmovne t0,0x1,v0 24: 01 80 fa 6b ret combine should have realized that t0 has at most the low bit set and cmpult therefore is always false. -- Summary: Combiner weakness Product: gcc Version: tree-ssa Status: UNCONFIRMED Keywords: pessimizes-code Severity: enhancement Priority: P2 Component: optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: falk at debian dot org CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: alphaev68-unknown-linux-gnu GCC host triplet: alphaev68-unknown-linux-gnu GCC target triplet: alphaev68-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14052