]> git.ipfire.org Git - thirdparty/gcc.git/commit
x86: Don't enable UINTR in 32-bit mode
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 9 Jul 2021 16:16:01 +0000 (09:16 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 14 Jul 2021 12:14:31 +0000 (05:14 -0700)
commitcc11b924bfe7752edbba052ca71653f46a60887a
tree99567aef1bd6acfdfb8ae6fa5587d8c752a280a5
parentf9c2ce1dae270d8d5dc261a57a21f96a1da5ea2d
x86: Don't enable UINTR in 32-bit mode

UINTR is available only in 64-bit mode.  Since the codegen target is
unknown when the the gcc driver is processing -march=native, to properly
handle UINTR for -march=native:

1. Pass "arch [32|64]" and "tune [32|64]" to host_detect_local_cpu to
indicate 32-bit and 64-bit codegen.
2. Change ix86_option_override_internal to enable UINTR only in 64-bit
mode for -march=CPU when PTA_CPU includes PTA_UINTR.

gcc/

PR target/101395
* config/i386/driver-i386.c (host_detect_local_cpu): Check
"arch [32|64]" and "tune [32|64]" for 32-bit and 64-bit codegen.
Enable UINTR only for 64-bit codegen.
* config/i386/i386-options.c
(ix86_option_override_internal::DEF_PTA): Skip PTA_UINTR if not
in 64-bit mode.
* config/i386/i386.h (ARCH_ARG): New.
(CC1_CPU_SPEC): Pass "[arch|tune] 32" for 32-bit codegen and
"[arch|tune] 64" for 64-bit codegen.

gcc/testsuite/

PR target/101395
* gcc.target/i386/pr101395-1.c: New test.
* gcc.target/i386/pr101395-2.c: Likewise.
* gcc.target/i386/pr101395-3.c: Likewise.
gcc/config/i386/driver-i386.c
gcc/config/i386/i386-options.c
gcc/config/i386/i386.h
gcc/testsuite/gcc.target/i386/pr101395-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr101395-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr101395-3.c [new file with mode: 0644]