From patchwork Mon Sep 1 10:43:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Tocar X-Patchwork-Id: 384752 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 98FDD1401B1 for ; Mon, 1 Sep 2014 20:43:37 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=sQLazZajyJFS8D6sMD3MDGtiG3UH2ylz0PzsPZeGmigId9/2LuBp5 Wwxm68Ci8sHN0nqgf1sKNscRseJfjoljGBvABVe0KUFup5SJBYLdx4rN0FYOfaqX oxF3Pg59Sr3gKPdLil6AciZ8xp3n4w7KN+yrqqUdAAJ1qcmBOeFjCI= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=oFZi2YCg54W/v3xi9XGcRYKpsvw=; b=SwEvxTdUtDo+h/dBLeS/ zVSduPxtXK5cs9m76GI9zfGmZjNjLmTI6fiyPTSzAGcyU3SHBA2OXgcwUaUXdvf7 vIvd/gchJ/TsQUcKCAPdOjbWQmLssMkdl0ivt2G1l06AjpagWhLPHDEKl6bOStaJ an+OCEWTUtWdZkIfJtOw1RU= Received: (qmail 5813 invoked by alias); 1 Sep 2014 10:43:30 -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 5792 invoked by uid 89); 1 Sep 2014 10:43:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS, SUBJ_ALL_CAPS autolearn=no version=3.3.2 X-HELO: mail-pd0-f180.google.com Received: from mail-pd0-f180.google.com (HELO mail-pd0-f180.google.com) (209.85.192.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 01 Sep 2014 10:43:28 +0000 Received: by mail-pd0-f180.google.com with SMTP id p10so5868865pdj.11 for ; Mon, 01 Sep 2014 03:43:26 -0700 (PDT) X-Received: by 10.66.222.97 with SMTP id ql1mr10600717pac.119.1409568206220; Mon, 01 Sep 2014 03:43:26 -0700 (PDT) Received: from msticlxl7.ims.intel.com (jfdmzpr03-ext.jf.intel.com. [134.134.139.72]) by mx.google.com with ESMTPSA id nh11sm679303pdb.69.2014.09.01.03.43.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Sep 2014 03:43:25 -0700 (PDT) Date: Mon, 1 Sep 2014 14:43:14 +0400 From: Ilya Tocar To: GCC Patches Subject: [PATCH] PR62120 Message-ID: <20140901104314.GB26266@msticlxl7.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, this patch adds checks for registers availability, when alternative/numeric name is used. Bootstraps/passes make-check on x86-64. Ok for trunk? ChangeLog: gcc/ 2014-09-01 Ilya Tocar * varasm.c (decode_reg_name_and_count): Check availability for registers from ADDITIONAL_REGISTER_NAMES. --- gcc/varasm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/varasm.c b/gcc/varasm.c index 9d8602b..1d6f79f 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -888,7 +888,7 @@ decode_reg_name_and_count (const char *asmspec, int *pnregs) if (asmspec[0] != 0 && i < 0) { i = atoi (asmspec); - if (i < FIRST_PSEUDO_REGISTER && i >= 0) + if (i < FIRST_PSEUDO_REGISTER && i >= 0 && reg_names[i][0]) return i; else return -2; @@ -925,7 +925,8 @@ decode_reg_name_and_count (const char *asmspec, int *pnregs) for (i = 0; i < (int) ARRAY_SIZE (table); i++) if (table[i].name[0] - && ! strcmp (asmspec, table[i].name)) + && ! strcmp (asmspec, table[i].name) + && reg_names[table[i].number][0]) return table[i].number; } #endif /* ADDITIONAL_REGISTER_NAMES */