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 <ebotca...@adacore.com>
* 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