https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26877
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:01eb1bb0237a24fe50ed0631857f3dfc31782f54 commit r10-6992-g01eb1bb0237a24fe50ed0631857f3dfc31782f54 Author: Jakub Jelinek <[email protected]> Date: Tue Mar 3 10:44:24 2020 +0100 s390: Fix --with-arch=... --with-tune=... [PR26877] In Fedora we configure GCC with --with-arch=zEC12 --with-tune=z13 right now and furthermore redhat-rpm-config adds to rpm packages -march=zEC12 -mtune=z13 options (among others). While looking at the git compilation, I've been surprised that -O2 actually behaves differently from -O2 -mtune=z13 in this configuration, and indeed, seems --with-tune= is completely ignored on s390 if --with-arch= is specified. i386 had the same problem, but got that fixed in 2006, see PR26877. The thing is that for tune, we add -mtune=%(VALUE) only if neither -mtune= nor -march= is present, but as arch is processed first, it adds -march=%(VALUE) first and then -march= is always present and so -mtune= is never added. By reordering it in OPTION_DEFAULT_SPECS, we process tune first, add the default -mtune=%(VALUE) if -mtune= or -march= isn't seen, and then add -march=%(VALUE) if -march= isn't seen. It is true that cc1 etc. will be then invoked with -mtune=z13 -march=zEC12, but like if the user specifies it in that order, it should still use z13 tuning and zEC12 ISA set. 2020-03-03 Jakub Jelinek <[email protected]> PR target/26877 * config/s390/s390.h (OPTION_DEFAULT_SPECS): Reorder.
