[S390] Change mtune default

Message ID f082d6d5-34c3-387c-3c24-e2ad69f568d1@linux.ibm.com
State New
Headers show
Series
  • [S390] Change mtune default
Related show

Commit Message

Robin Dapp June 4, 2018, 12:26 p.m.
Hi,

when building with --with-tune=zEC12 and calling the resulting gcc with
--march=z13 (no extra -mtune), the binary would unexpectedly be compiled
with -march=z13 -mtune=zEC12.  This patch avoids using the default tune
parameter if -march is specified as argument but the user can still
explicitly state -march=z13 -mtune=zEC12.

Regards
 Robin

--

gcc/ChangeLog:

2018-06-04  Robin Dapp  <rdapp@linux.vnet.ibm.com>

	* config/s390/s390.h (enum processor_flags): Do not use
	default tune parameter when -march was specified.

Comments

Andreas Krebbel June 5, 2018, 2:23 p.m. | #1
On 06/04/2018 02:26 PM, Robin Dapp wrote:
> Hi,

> 

> when building with --with-tune=zEC12 and calling the resulting gcc with

> --march=z13 (no extra -mtune), the binary would unexpectedly be compiled

> with -march=z13 -mtune=zEC12.  This patch avoids using the default tune

> parameter if -march is specified as argument but the user can still

> explicitly state -march=z13 -mtune=zEC12.

> 

> Regards

>  Robin

> 

> --

> 

> gcc/ChangeLog:

> 

> 2018-06-04  Robin Dapp  <rdapp@linux.vnet.ibm.com>

> 

> 	* config/s390/s390.h (enum processor_flags): Do not use

> 	default tune parameter when -march was specified.

> 


Ok. Thanks!

-Andreas-

Patch

diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index a372981ff3a..ed0dfa19bb6 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -205,7 +205,7 @@  enum processor_flags
 #define OPTION_DEFAULT_SPECS 					\
   { "mode", "%{!mesa:%{!mzarch:-m%(VALUE)}}" },			\
   { "arch", "%{!march=*:-march=%(VALUE)}" },			\
-  { "tune", "%{!mtune=*:-mtune=%(VALUE)}" }
+  { "tune", "%{!mtune=*:%{!march=*:-mtune=%(VALUE)}}" }
 
 #ifdef __s390__
 extern const char *s390_host_detect_local_cpu (int argc, const char **argv);