From patchwork Tue Dec 14 00:30:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: asharif tools X-Patchwork-Id: 75441 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 B96F2B6EE9 for ; Tue, 14 Dec 2010 11:30:43 +1100 (EST) Received: (qmail 11223 invoked by alias); 14 Dec 2010 00:30:40 -0000 Received: (qmail 11214 invoked by uid 22791); 14 Dec 2010 00:30:38 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Dec 2010 00:30:33 +0000 Received: by ywi6 with SMTP id 6so36437ywi.20 for ; Mon, 13 Dec 2010 16:30:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.109.3 with SMTP id r3mr1708294yhg.30.1292286631133; Mon, 13 Dec 2010 16:30:31 -0800 (PST) Received: by 10.236.109.18 with HTTP; Mon, 13 Dec 2010 16:30:31 -0800 (PST) In-Reply-To: References: <20101213170015.GA27214@tyan-ft48-01.lab.bos.redhat.com> Date: Mon, 13 Dec 2010 16:30:31 -0800 Message-ID: Subject: Re: [PATCH] Add testcase for possible bug in gcc-4_4 ix86 branch From: asharif tools To: "H.J. Lu" Cc: Jakub Jelinek , Diego Novillo , gcc-patches@gcc.gnu.org, iant@google.com X-IsSubscribed: yes 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 I rolled back my earlier patch containing the testcase quoted below. I have addressed the following concerns: 1. Initialized the variables. 2. Added a testcase filter to only run on x86_64. 3. Added a valid label to jump to. This file compiles fine with trunk, but does not compile with the ix86 branch which has a patch that limits the stack alignment. How does it look? Here is an updated patch: On Mon, Dec 13, 2010 at 9:08 AM, H.J. Lu wrote: > On Mon, Dec 13, 2010 at 9:00 AM, Jakub Jelinek wrote: >> On Thu, Dec 09, 2010 at 11:16:12AM -0500, Diego Novillo wrote: >>> On Tue, Dec 7, 2010 at 20:32, asharif tools wrote: >>> >>> > 2010-12-7 Ahmad Sharif >>> > >>> >  * gcc.target/i386/max-stack-align.c: New. >>> >>> OK if this passes on trunk. >> >> It doesn't on i386, but it has been apparently committed. >> void foo() >> { >>  int a, b, c, e, f, g, h, i; >>       __asm__ volatile( " jb 1b \n\t" >>                         : : "c" (a), "d" (a), "S" (a), "D" (a), >>                         "r" (a), "a" (a) ,"r" (a), "r" (a) >>                         : "%""rbp" ); >> } >> >> %rbp there looks x86-64ish, was the testcase meant just for x86-64 and not >> i?86?  Then you'd need to add { target lp64 } requirement. >> >> jb 1b when no 1: label is defined is only weird, you shouldn't put anything >> in there probably, preferrably not garbage as is done.  The variables are >> all uninitialized, so the whole testcase is very questionable. >> >> And on i386 it expectedly fails with (%esp is reserved, %ebx on some targets >> that default to -fpic, or if -fpic is used in board flags, then you >> request another 8 registers (while i386 has just 8 in total)): >> >> /usr/src/gcc/gcc/testsuite/gcc.target/i386/max-stack-align.c: In function 'foo': >> /usr/src/gcc/gcc/testsuite/gcc.target/i386/max-stack-align.c:7:8: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm' >> /usr/src/gcc/gcc/testsuite/gcc.target/i386/max-stack-align.c:7:8: error: 'asm' operand has impossible constraints >> > > This is: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46895 > > > -- > H.J. > Index: gcc/testsuite/gcc.target/i386/max-stack-align.c =================================================================== --- gcc/testsuite/gcc.target/i386/max-stack-align.c (revision 0) +++ gcc/testsuite/gcc.target/i386/max-stack-align.c (revision 0) @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-fomit-frame-pointer" } */ +/* { dg-require-effective-target lp64 } */ + +void foo() +{ + int a=0, b=0, c=0, e=0, f=0, g=0, h=0, i=0; +label: + __asm__ volatile( " jb label " + : : "c" (a), "d" (a), "S" (a), "D" (a), "r" (a), "a" (a) ,"r" (a), "r" (a) + : "%""rbp" ); +} +