From patchwork Fri Jan 30 10:07:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 434794 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42835140281 for ; Fri, 30 Jan 2015 21:08:26 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=WuuGsGrqvIdD6QRJth 2vDXN5eD0tSD1zWifPeo8YpWAI3q/87wbQqhZhl2gmHhsVQSdtNgWJCRR9x8wm/A zinbnBJLI+xSInc4aM7visGvto5+4wGEuUR4RZLdQGEfw4S75mDRWIoSVzeFgouB NYgBBfe7cTpmzal+aIGlza91Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=s75+i0kEwDp7ZWtStAaVO0dR +24=; b=cgwZ35KvksJ0z0UaII3GDvbutBWR9m0Wq+NnSYVoRr80Ub6T+KGAqUsz NkCmyfiHs2gQAL/U07iLiB9+qLNqydXb4ApTYwuBYNYNw10MNnD1hRAj7c4dOVmI IBCwmgIzOukyRgxYPDq6uy5FI2T9eUpiNsh+no6PRx0AEB5EFTk= Received: (qmail 9209 invoked by alias); 30 Jan 2015 10:07:51 -0000 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 Received: (qmail 9135 invoked by uid 89); 30 Jan 2015 10:07:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f44.google.com Received: from mail-oi0-f44.google.com (HELO mail-oi0-f44.google.com) (209.85.218.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 30 Jan 2015 10:07:47 +0000 Received: by mail-oi0-f44.google.com with SMTP id a3so33888918oib.3 for ; Fri, 30 Jan 2015 02:07:45 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.202.176.4 with SMTP id z4mr3018912oie.43.1422612465366; Fri, 30 Jan 2015 02:07:45 -0800 (PST) Received: by 10.60.159.166 with HTTP; Fri, 30 Jan 2015 02:07:45 -0800 (PST) In-Reply-To: <54CB20CA.3070709@redhat.com> References: <54CB20CA.3070709@redhat.com> Date: Fri, 30 Jan 2015 11:07:45 +0100 Message-ID: Subject: Re: [PATCH][PR target/15184] Fix for direct byte access on x86 From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" Cc: Jeff Law , Jakub Jelinek , Dominique Dhumieres On Fri, Jan 30, 2015 at 7:12 AM, Jeff Law wrote: >> Hello! >> >>> So here's the updated patch which handles all 4 testcases from the PR as >>> well as a couple of my own. >> >> >> @@ -0,0 +1,33 @@ >> +/* PR 15184 first two tests, plus two addition ones. */ >> +/* { dg-do compile } */ >> +/* { dg-options "-O2 -m32 -march=pentiumpro" } */ >> >> No, we don't want -m32 in dg-options. Please write this part as: >> >> /* { dg-do compile { target ia32 } } */ >> /* { dg-options "-O2 -march=pentiumpro" } */ > > Will update after sniff testing. Sorry for the noise. I'll commit the attached patch that fixes this and -fpic problem as soon as regtest finishes. 2015-01-30 Uros Bizjak * gcc.target/i386/pr15184-1.c: Compile for ia32 target only. (dg-options): Remove -m32. (dg-final): Scan for "movb %al" only. * gcc.target/i386/pr15184-2.c: Ditto. Uros. Index: gcc.target/i386/pr15184-1.c =================================================================== --- gcc.target/i386/pr15184-1.c (revision 220273) +++ gcc.target/i386/pr15184-1.c (working copy) @@ -1,11 +1,10 @@ /* PR 15184 first two tests, plus two addition ones. */ -/* { dg-do compile } */ -/* { dg-options "-O2 -m32 -march=pentiumpro" } */ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-O2 -march=pentiumpro" } */ -#define regparm __attribute__((__regparm__(3))) +#define regparm __attribute__((__regparm__(1))) extern unsigned int x; -extern unsigned short y; void regparm f0(unsigned char c) { @@ -29,5 +28,5 @@ /* Each function should compile down to a byte move from the input register into x, possibly at an offset within x. */ -/* { dg-final { scan-assembler-times "\tmovb\t%al, x" 4 } } */ +/* { dg-final { scan-assembler-times "movb\[ \\t\]+%al" 4 } } */ Index: gcc.target/i386/pr15184-2.c =================================================================== --- gcc.target/i386/pr15184-2.c (revision 220273) +++ gcc.target/i386/pr15184-2.c (working copy) @@ -1,10 +1,9 @@ /* PR 15184 second two tests -/* { dg-do compile } */ -/* { dg-options "-O2 -m32 -march=pentiumpro" } */ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-O2 -march=pentiumpro" } */ -#define regparm __attribute__((__regparm__(3))) +#define regparm __attribute__((__regparm__(1))) -extern unsigned int x; extern unsigned short y; void regparm g0(unsigned char c) @@ -18,6 +17,6 @@ } /* Each function should compile down to a byte move from - the input register into x, possibly at an offset within x. */ -/* { dg-final { scan-assembler-times "\tmovb\t%al, y" 2 } } */ + the input register into y, possibly at an offset within y. */ +/* { dg-final { scan-assembler-times "movb\[ \\t\]+%al" 2 } } */