From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15335 invoked by alias); 25 May 2010 08:12:24 -0000 Received: (qmail 15213 invoked by alias); 25 May 2010 08:11:55 -0000 Date: Tue, 25 May 2010 08:12:00 -0000 Message-ID: <20100525081155.15212.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/28685] Multiple comparisons are not simplified In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenther at suse dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-05/txt/msg02818.txt.bz2 ------- Comment #14 from rguenther at suse dot de 2010-05-25 08:11 ------- Subject: Re: Multiple comparisons are not simplified On Mon, 24 May 2010, sandra at codesourcery dot com wrote: > ------- Comment #13 from sandra at codesourcery dot com 2010-05-24 13:21 ------- > I'm working on a patch that fixes the test case in comment #5 (originally filed > as PR 39874) and some other test cases by improving the comparison combination > logic in both tree-ssa-ifcombine and tree-ssa-reassoc. > > The test case in comment #4 is a somewhat different problem -- maybe it is a > VRP failure? The problem is figuring out the right place to attempt to combine > the comparisons.... In this case it is probably phiopt that could recognize this (though it does not do the kind of transformation). It could transform : eq_5 = a_2(D) == b_3(D); if (a_2(D) < b_3(D)) goto ; else goto ; : : # eq_1 = PHI <1(2), eq_5(3)> return eq_1; to : if (a_2(D) <= b_3(D)) goto ; else goto ; : : # eq_1 = PHI <1(2), 0(3)> return eq_1; and eventually further if-convert that. Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28685