From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12902 invoked by alias); 11 Jul 2002 05:46:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 12883 invoked by uid 71); 11 Jul 2002 05:46:00 -0000 Resent-Date: 11 Jul 2002 05:46:00 -0000 Resent-Message-ID: <20020711054600.12882.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, anamax@earthlink.net Received: (qmail 11032 invoked by uid 61); 11 Jul 2002 05:36:56 -0000 Message-Id: <20020711053656.11031.qmail@sources.redhat.com> Date: Wed, 10 Jul 2002 22:46:00 -0000 From: anamax@earthlink.net Reply-To: anamax@earthlink.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: optimization/7270: Redundant compares not eliminated on x86. X-SW-Source: 2002-07/txt/msg00319.txt.bz2 List-Id: >Number: 7270 >Category: optimization >Synopsis: Redundant compares not eliminated on x86. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: pessimizes-code >Submitter-Id: net >Arrival-Date: Wed Jul 10 22:46:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Andy Freeman >Release: gcc 3.1 >Organization: >Environment: Redhat 7.3 >Description: A <= compare&branch followed by a == test on the same arguments uses a redundant compare for the == on x86. Using built-in specs. Configured with: ../gcc-3.1/configure Thread model: single gcc version 3.1 >How-To-Repeat: Look at the -O3 -S output for x86. Notice the two cmpls on either side of the "ja .L4". I believe that the second cmpl is unnecessary as the flags from the first should survive the "ja .L4". >Fix: Better value propagation. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="ii.cc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ii.cc" dW5zaWduZWQgZm9vKHVuc2lnbmVkIGFbXSkgew0KICBmb3IoIHVuc2lnbmVkIGkgPSAwOyBpIDwg MTA7ICsraSApIHsNCiAgICBpZiggaSA8PSBhW2ldICkgew0KICAgICAgaWYoIGkgPT0gYVtpXSAp IHsNCglyZXR1cm4gOTsNCiAgICAgIH0gZWxzZSB7DQoJcmV0dXJuIDE1Ow0KICAgICAgfQ0KICAg IH0NCiAgfQ0KfQ0K