From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17137 invoked by alias); 23 Feb 2003 07:46:00 -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 17100 invoked by uid 71); 23 Feb 2003 07:46:00 -0000 Resent-Date: 23 Feb 2003 07:46:00 -0000 Resent-Message-ID: <20030223074600.17098.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, herbert@gondor.apana.org.au Resent-Reply-To: gcc-gnats@gcc.gnu.org, 181096@bugs.debian.org Received: (qmail 17027 invoked from network); 23 Feb 2003 07:45:40 -0000 Received: from unknown (HELO hirsch.in-berlin.de) (192.109.42.6) by 172.16.49.205 with SMTP; 23 Feb 2003 07:45:40 -0000 Received: from tango.net.local (mail@dsl-213-023-022-197.arcor-ip.net [213.23.22.197]) (authenticated bits=0) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with ESMTP id h1N7jcuP021139 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT); Sun, 23 Feb 2003 08:45:39 +0100 Received: from doko by tango.net.local with local (Exim 4.12 #1 (Debian) [+araqnid]) id 18mqpN-00087i-00; Sun, 23 Feb 2003 08:45:37 +0100 Message-Id: Date: Sun, 23 Feb 2003 07:46:00 -0000 From: Matthias Klose Reply-To: 181096@bugs.debian.org To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version: 3.113 X-GNATS-Notify: herbert@gondor.apana.org.au Subject: optimization/9814: gcc fails to optimise if (l&2) l|=2 away X-SW-Source: 2003-02/txt/msg01149.txt.bz2 List-Id: >Number: 9814 >Category: optimization >Synopsis: gcc fails to optimise if (l&2) l|=2 away >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: change-request >Submitter-Id: net >Arrival-Date: Sun Feb 23 07:46:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: herbert@gondor.apana.org.au >Release: 3.2.2 (Debian) (Debian unstable) >Organization: The Debian Project >Environment: System: Debian GNU/Linux (unstable) Architecture: i686 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ ii gcc-3.2 3.2.3-0pre1 The GNU C compiler ii g++-3.2 3.2.3-0pre1 The GNU C++ compiler ii libstdc++5 3.2.3-0pre1 The GNU Standard C++ Library v3 ii libstdc++5-dev 3.2.3-0pre1 The GNU Standard C++ Library v3 (development ii binutils 2.13.90.0.18-1 The GNU assembler, linker and binary utiliti ii libc6 2.3.1-13 GNU C Library: Shared libraries and Timezone host: i386-linux >Description: [ Reported to the Debian BTS as report #181096. Please CC 181096@bugs.debian.org on replies. Log of report can be found at http://bugs.debian.org/181096 ] Checked with current 3.2 and 3.3 branches (20030221) The following function doesn't get optimised away as a noop: int k(int l) { if (l & 2) l |= 2; return l; } $ gcc-3.2 -O2 -S b.c $ cat b.s .file "b.c" .text .p2align 2,,3 .globl k .type k,@function k: pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax testl $2, %eax je .L2 orl $2, %eax .L2: leave ret .Lfe1: .size k,.Lfe1-k .ident "GCC: (GNU) 3.2.3 20030210 (Debian prerelease)" >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: