From patchwork Wed Sep 5 11:48:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 966328 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-485164-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="FWsmQGJY"; dkim-atps=neutral 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 4252800bNLz9s5c for ; Wed, 5 Sep 2018 21:50:23 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=fNF3lOI+8KmuDcCcZSLfezOupkRT0 B6oQHCLQRRT0cCsYD0go/+0XBHU4jA4hmXO+zkdQx3fB27eVBGFDRDUxAnQGkkTm I7iep9opVsoCofXoENouHsO8BOIiH5CKD1lEcF1lPdhzPNM3nTWxwmhY0OWs+Bkr 9CORFvDEEVRmEg= 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:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=axxu3If8kVyyJt5ZbkZSwstQCd4=; b=FWs mQGJYVCGifYgyo6jCx52unJmN/RZiFaeSBKszTxglJ/iheO/bQ1OwEXUdYOYQTnh jLVDGJRM8+MxSF1CC5uRP0L6m19Hdc0+epxeXGFbVaA+8gAfBn5L0Q3Ku3YWWlEi AKlkV5ubsGuZBPawZQWGXBUP4psdCivx7BGdaHrs= Received: (qmail 80859 invoked by alias); 5 Sep 2018 11:49:39 -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 80458 invoked by uid 89); 5 Sep 2018 11:49:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SUBJ_ALL_CAPS autolearn=ham version=3.3.2 spammy=respectively, HX-detected-operating-system:fuzzy, HX-detected-operating-system:kernel, HX-detected-operating-system:Windows X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Sep 2018 11:49:23 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxWJB-0001kf-FM for gcc-patches@gcc.gnu.org; Wed, 05 Sep 2018 07:49:20 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:45291) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fxWJB-0001il-7R for gcc-patches@gcc.gnu.org; Wed, 05 Sep 2018 07:49:17 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1fxWJ9-0005Tp-4i from Andrew_Stubbs@mentor.com for gcc-patches@gcc.gnu.org; Wed, 05 Sep 2018 04:49:15 -0700 Received: from build6-trusty-cs.sje.mentorg.com (137.202.0.90) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 5 Sep 2018 12:49:10 +0100 From: To: Subject: [PATCH 04/25] SPECIAL_REGNO_P Date: Wed, 5 Sep 2018 12:48:52 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 GCN has some registers which are special purpose, but not "fixed" because we want the register allocator to track their usage and select alternatives that use different special registers (e.g. scalar cc vs. vector cc). Sometimes this leads the regrename pass to ICE. Quite how it gets confused is not well understood, but considering such registers for renaming is surely not useful. This patch creates a new macro SPECIAL_REGNO_P which disables regrename. In other words, the register is fixed once allocated. 2018-09-05 Kwok Cheung Yeung gcc/ * defaults.h (SPECIAL_REGNO_P): Define to false by default. * regrename.c (check_new_reg_p): Do not rename to a special register. (rename_chains): Do not rename special registers. --- gcc/defaults.h | 4 ++++ gcc/regrename.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/gcc/defaults.h b/gcc/defaults.h index 9035b33..40ecf61 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -1198,6 +1198,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define NO_FUNCTION_CSE false #endif +#ifndef SPECIAL_REGNO_P +#define SPECIAL_REGNO_P(REGNO) false +#endif + #ifndef HARD_REGNO_RENAME_OK #define HARD_REGNO_RENAME_OK(FROM, TO) true #endif diff --git a/gcc/regrename.c b/gcc/regrename.c index 8424093..92e403e 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -320,6 +320,7 @@ check_new_reg_p (int reg ATTRIBUTE_UNUSED, int new_reg, if (TEST_HARD_REG_BIT (this_unavailable, new_reg + i) || fixed_regs[new_reg + i] || global_regs[new_reg + i] + || SPECIAL_REGNO_P (new_reg + i) /* Can't use regs which aren't saved by the prologue. */ || (! df_regs_ever_live_p (new_reg + i) && ! call_used_regs[new_reg + i]) @@ -480,6 +481,7 @@ rename_chains (void) continue; if (fixed_regs[reg] || global_regs[reg] + || SPECIAL_REGNO_P (reg) || (!HARD_FRAME_POINTER_IS_FRAME_POINTER && frame_pointer_needed && reg == HARD_FRAME_POINTER_REGNUM) || (HARD_FRAME_POINTER_IS_FRAME_POINTER && frame_pointer_needed