From patchwork Tue Jan 3 21:15:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 89739 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp8199179qgi; Tue, 3 Jan 2017 13:15:52 -0800 (PST) X-Received: by 10.98.155.9 with SMTP id r9mr59924517pfd.71.1483478151938; Tue, 03 Jan 2017 13:15:51 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id x69si18902818pfd.196.2017.01.03.13.15.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2017 13:15:51 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-445277-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-445277-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-445277-patch=linaro.org@gcc.gnu.org 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:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=EKWr0LLlEr+YVVuD JclhIGa3IOwGoaTdF+2rhZHrV4p1T+VcwSVELbP4c/HrtUsuzVe2AwjmtY6gN2cK Vgg6nV9VVs+vUP3SkOannRzAgJ9fuS3yTBv6m2UjoTzJVpz7cwmETf0Ha3aagD+V Bu4YQc/GNiqshBoSTykC/U9FfDM= 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:mime-version:content-type :content-transfer-encoding; s=default; bh=2mMnu2lAW+okfocO4sEcm4 myvsY=; b=R4HH3Q17ZmvVpdl5WmLVyMw2ORk7OwjbfZ+vEg14BuB06/v7fnVRgq HYI56yVL/i86+I2kJkS99m3wa7yC2R0UAs+DWn+dJWdntgPeGdOIWbdcuN6GQyQ2 rdb/B8vtjYDzUXCulNJQK8V9/a/+qzPO6LXL+KaTi+ig3He+AcKec= Received: (qmail 54101 invoked by alias); 3 Jan 2017 21:15:37 -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 53904 invoked by uid 89); 3 Jan 2017 21:15:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 spammy=sk:ebotcaz, U*ebotcazou, Reload, ebotcazouadacorecom X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Jan 2017 21:15:18 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id C6F0282ABC for ; Tue, 3 Jan 2017 22:15:13 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NToiNkOpl3zz for ; Tue, 3 Jan 2017 22:15:13 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id A1FFB82AAB for ; Tue, 3 Jan 2017 22:15:13 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [SPARC] Enable LRA by default Date: Tue, 03 Jan 2017 22:15:12 +0100 Message-ID: <2745386.938xFeTRRJ@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 I changed my mind and decided to give it a try for GCC 7, after bootstrapping and testing the 32-bit and 64-bit compilers, both in development and release modes, over the last weeks. The few encountered issues were minor: missed optimization in a specific case (PR rtl-optimization/78664) and compilation time explosion on a pathological Go testcase at -O0 (I'll open another PR if/when I can come up with an equivalent C/C++ testcase). Tested on SPARC/Solaris in various configurations, applied on the mainline. I also updated htdocs/backends.html in the wwwdocs module. 2017-01-03 Eric Botcazou * doc/invoke.texi (SPARC options): Document -mlra as the default. * config/sparc/sparc.c (sparc_option_override): Force LRA unless -mlra/-mno-lra was passed to the compiler. -- Eric Botcazou Index: doc/invoke.texi =================================================================== --- doc/invoke.texi (revision 244005) +++ doc/invoke.texi (working copy) @@ -23271,8 +23271,8 @@ in 64-bit mode. @itemx -mno-lra @opindex mlra @opindex mno-lra -Enable Local Register Allocation. This is experimental for SPARC, so by -default the compiler uses standard reload (i.e. @option{-mno-lra}). +Enable Local Register Allocation. This is the default for SPARC since GCC 7 +so @option{-mno-lra} needs to be passed to get old Reload. @item -mcpu=@var{cpu_type} @opindex mcpu Index: config/sparc/sparc.c =================================================================== --- config/sparc/sparc.c (revision 244005) +++ config/sparc/sparc.c (working copy) @@ -1523,6 +1523,10 @@ sparc_option_override (void) if (TARGET_ARCH32) target_flags &= ~MASK_STACK_BIAS; + /* Use LRA instead of reload, unless otherwise instructed. */ + if (!(target_flags_explicit & MASK_LRA)) + target_flags |= MASK_LRA; + /* Supply a default value for align_functions. */ if (align_functions == 0 && (sparc_cpu == PROCESSOR_ULTRASPARC