From patchwork Mon Nov 5 23:57:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 197363 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 50B7C2C00BD for ; Tue, 6 Nov 2012 10:57:25 +1100 (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=1352764646; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References: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=5JKrAQt7IwHBrI0fee4s8EkLK5U=; b=n0pXQVNQODC0gIB dtCac2RambQyPh6hGa8NnupBuMt0YV+Fk9m8VMJmZnVi8X17JJPl/hmdhCnuEXgt 1zpHiqI7z6xcNiiLLoMPqXa9OlcMeBKHTbQERTPxejvfDLLoJbHUV9L4FZtzz0Ma AsIWMUSkUtl68ehhT9iC7ZbKUpgE= 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:In-Reply-To:References:Date:Message-ID:Subject:From:To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=CLM9F0hN1KZ7+7JLja5jIYYi5I9WNu6ebE//zgKQJjcr+MFU7Z6zJziYRWH1Jb ZawM6BC9xiJJONCdA3xMrZ7rRE0vXSJCRjGOjkWs1q8i/O06B0TA9OR53KxqukmW +EE+HIIGM0dE/ZUw6LymeG4mi/C0YYOWZCeQHDsA9dVyM=; Received: (qmail 25154 invoked by alias); 5 Nov 2012 23:57:19 -0000 Received: (qmail 25145 invoked by uid 22791); 5 Nov 2012 23:57:18 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Nov 2012 23:57:14 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa11so4084602pad.20 for ; Mon, 05 Nov 2012 15:57:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.189.233 with SMTP id gl9mr34505126pbc.166.1352159834414; Mon, 05 Nov 2012 15:57:14 -0800 (PST) Received: by 10.68.19.138 with HTTP; Mon, 5 Nov 2012 15:57:14 -0800 (PST) In-Reply-To: References: <87wqy0cuzt.fsf@talisman.home> <87sj8ndgl0.fsf@talisman.home> Date: Mon, 5 Nov 2012 15:57:14 -0800 Message-ID: Subject: Re: [x86] Fix gcc.c-torture/compile/20080806-1.c failures From: "H.J. Lu" To: Uros Bizjak , gcc-patches@gcc.gnu.org, rdsandiford@googlemail.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 On Mon, Nov 5, 2012 at 3:34 PM, H.J. Lu wrote: > On Mon, Nov 5, 2012 at 10:56 AM, Richard Sandiford > wrote: >> Uros Bizjak writes: >>> On Mon, Nov 5, 2012 at 9:30 AM, Richard Sandiford >>> wrote: >>>> gcc/ >>>> PR target/55204 >>>> * config/i386/i386.c (ix86_address_subreg_operand): Remove stack >>>> pointer check. >>>> (print_reg): Use true_regnum rather than REGNO. >>>> (ix86_print_operand_address): Remove SUBREG handling. >>> >>> The patch is OK for mainline and 4.7, if it passes H.J.'s tests with >>> -maddress-mode={short,long} on x32. >>> >>>> + unsigned int regno = true_regnum (x); >>> >>> I'd rather see the declaration at the beginning of the function. >> >> OK, thanks, applied to both with that change. >> >> Richard > > > On 4.7 branch, this failed to build x32 run-time library: > > /tmp/ccID3vr6.s: Assembler messages: > /tmp/ccID3vr6.s:2788: Error: bad register name `%rr15' > > There is an extra 'r' in register name. > > -- > H.J. I think this is a real bug: case 8: case 4: case 12: if (! ANY_FP_REG_P (x)) putc (code == 8 && TARGET_64BIT ? 'r' : 'e', file); /* FALLTHRU */ case 16: case 2: normal: reg = hi_reg_name[regno]; break; hi_reg_name has #define HI_REGISTER_NAMES \ {"ax","dx","cx","bx","si","di","bp","sp", \ "st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)", \ "argp", "flags", "fpsr", "fpcr", "frame", \ "xmm0","xmm1","xmm2","xmm3","xmm4","xmm5","xmm6","xmm7", \ "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", \ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"} If we ever use r8 to r15, we print wrong register name. We should catch it with /* Irritatingly, AMD extended registers use different naming convention from the normal registers: "r%d[bwd]" */ if (REX_INT_REG_P (x)) But it doesn't work with subreg change. I am testing this I will check it into trunk and 4.7 branch if test passes. Thanks. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 37498ef..b42870f 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -13729,7 +13729,7 @@ print_reg (rtx x, int code, FILE *file) /* Irritatingly, AMD extended registers use different naming convention from the normal registers: "r%d[bwd]" */ - if (REX_INT_REG_P (x)) + if (REX_INT_REGNO_P (regno)) { gcc_assert (TARGET_64BIT); putc ('r', file);