[RS6000] Make assembler command line cpu match default for gcc

Programming / Compilers / GCC - amodra [138bc75d-0d04-0410-961f-82ee72b054a4] - 28 July 2019 09:26 EDT

When gcc is configured using --with-cpu=, the specified cpu effectively becomes a default -mcpu= passed to gcc. This then affects the cpu passed to gas via ASM_CPU_SPEC. If gcc is not configured using --with-cpu then the cpu passed to gas is that given by ASM_DEFAULT_SPEC, which currently does not match the default flags selected in default64.h. This patch makes ASM_DEFAULT_SPEC agree with TARGET_DEFAULT flags.

rs6000/default64.h appears in three places in config.gcc, the first one immediately followed by rs6000/freebsd64.h in $tm_file, and the other two immediately followed by rs6000/linux64.h. To be able to define ASM_DEFAULT_SPEC in rs6000/default64.h we don't want to redefine in the other two files. rs6000/freebsd64.h is easy since that file is always preceded by rs6000/default64.h, but rs6000/linux64.h can appear without rs6000/default64.h (a powerpc*-linux config where the default is -m32). In that case we will have TARGET_DEFAULT flags of 0 (from rs6000/sysv4.h) and want to use -mppc without -m64 and -mppc64 with -m64. This can be done by using the rs6000/rtems.h ASM_DEFAULT_SPEC in rs6000/sysv4.h, a change that won't affect sysv4 configurations where -m64 is invalid.

The patch also introduces ASM_DEFAULT_EXTRA for the altivec variant targets so as to enable -maltivec by default.

PR target/91050
- config/rs6000/sysv4.h (ASM_DEFAULT_SPEC): Modify if -m64.
- config/rs6000/default64.h (ASM_DEFAULT_SPEC): Define.
- config/rs6000/freebsd64.h (ASM_DEFAULT_SPEC): Don't define.
- config/rs6000/linux64.h (ASM_DEFAULT_SPEC): Likewise.
- config/rs6000/rtems.h (ASM_DEFAULT_SPEC): Likewise.
- config/rs6000/rs6000.h (ASM_DEFAULT_EXTRA): Define and use in asm_default spec.
- config/rs6000/eabialtivec.h (ASM_DEFAULT_EXTRA): Redefine.
- config/rs6000/linuxaltivec.h (ASM_DEFAULT_EXTRA): Redefine.

dbc3890fdaa [RS6000] Make assembler command line cpu match default for gcc
gcc/ChangeLog | 13 +++++++++++++
gcc/config/rs6000/default64.h | 4 ++++
gcc/config/rs6000/eabialtivec.h | 3 +++
gcc/config/rs6000/freebsd64.h | 2 --
gcc/config/rs6000/linux64.h | 4 ----
gcc/config/rs6000/linuxaltivec.h | 3 +++
gcc/config/rs6000/rs6000.h | 3 ++-
gcc/config/rs6000/rtems.h | 3 ---
gcc/config/rs6000/sysv4.h | 2 +-
9 files changed, 26 insertions(+), 11 deletions(-)

Upstream: gcc.gnu.org

  • Share