From patchwork Sun Sep 30 19:26:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 188192 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3C19A2C00CF for ; Mon, 1 Oct 2012 05:26:11 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1349637972; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=lA3GOXt klVNZGCbh1XBFhYS3sOc=; b=MG/y8/FZ1tmMZwcGVGKFd68hZSpePraPx11IJKH zSbQkQ3iJDpVWCTqBNhTff5xYH/nCMakrDwEKXuD4ZHTfQbZREm7Z3TGSQJfdGEP cCZeVJQjZljdlAoo7SHP/n89H0lYvu4o9MTJCrisN3phmoGca+BjTmfviyzlK4Wb uMCs= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=UwMRpqBMC427t6P7wWBWpDShVUfK36gbLO0wXUgtDocAwSppD3D5EzwV50zedh KDViMUuNMiAWiK2OSLnGQdPEcO6/u5u+JbYgSrUU/vdDo8QvonaC2pDRuSNAKZXc ByLZRnmaIFzE06FmtfgFo4hLdb8/zG1WbJQva15URR0x8=; Received: (qmail 8917 invoked by alias); 30 Sep 2012 19:26:08 -0000 Received: (qmail 8909 invoked by uid 22791); 30 Sep 2012 19:26:07 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 30 Sep 2012 19:26:01 +0000 Received: by pbbro12 with SMTP id ro12so7289372pbb.20 for ; Sun, 30 Sep 2012 12:26:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.217.104 with SMTP id ox8mr27412408pbc.35.1349033160560; Sun, 30 Sep 2012 12:26:00 -0700 (PDT) Received: by 10.66.20.232 with HTTP; Sun, 30 Sep 2012 12:26:00 -0700 (PDT) Date: Sun, 30 Sep 2012 21:26:00 +0200 Message-ID: Subject: [PATCH, i386]: Fix spurious testsuite failure in gcc.target/i386/pad-10.c From: Uros Bizjak To: gcc-patches@gcc.gnu.org Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hello! Recently, gcc become smart enough to merge: leal (%rdi), %eax addl %esi, %eax into leal (%rsi,%rdi), %eax The generated sequence (without ret) becomes shorter than 4 instructions: cmpl $1, %esi leal (%rsi,%rdi), %eax je .L8 nop nop ret and nop insertion for ATOM was triggered. Following patch changes arithmetic to again generate correct number of instructions, without compromising the intention of the test. leal (%rsi), %eax subl %edi, %eax cmpl $1, %esi je .L8 ret 2012-09-30 Uros Bizjak * gcc.target/i386/pad-10.c (foo2): Return x - z. Tested on x86_64-pc-linux-gnu, committed to mainline SVN. Uros. Index: gcc.target/i386/pad-10.c =================================================================== --- gcc.target/i386/pad-10.c (revision 191866) +++ gcc.target/i386/pad-10.c (working copy) @@ -15,5 +15,5 @@ return z; } else - return x + z; + return x - z; }