From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16368 invoked by alias); 10 Jun 2011 20:01:14 -0000 Received: (qmail 16358 invoked by uid 22791); 10 Jun 2011 20:01:13 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_GJ,TW_XF X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Jun 2011 20:00:57 +0000 From: "gjl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/43088] [avr] Suspect optimizer missed code in gcc 4.4.3.. X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: gjl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords CC Known to fail Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 10 Jun 2011 20:01:00 -0000 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: 2011-06/txt/msg00924.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43088 Georg-Johann Lay changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization CC| |gjl at gcc dot gnu.org Known to fail| | --- Comment #5 from Georg-Johann Lay 2011-06-10 19:59:47 UTC --- Funnc artifact. It occurs only if all low-bits are set, i.e. wich constants 0x3f, 0x1f, 0xf, ... So persumably a middle and pass makes some strange assumption. (In reply to comment #1) > This bug is confirmed. andhi3/andsi3 causing this problem. conditional checks > in andhi3 and andsi3 need to compare with zero instead of 0xff [etc]. > i.e. in andhi3 we need to replace > (mask & 0x00ff) != 0xff by (mask & 0x00ff) != 0. > > Similarly other checks in andhi3 and andsi3 need to be replaced. Can you explain? ANDding on a 8-bit part can only be omitted if the mask is 0xff. Otherwise, the AND has to be performed, even if the result is known to be always zero.