public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids
@ 2021-07-09 15:24 wwwhhhyyy333 at gmail dot com
2021-07-09 16:21 ` [Bug target/101395] [11/12 regression] " hjl.tools at gmail dot com
` (14 more replies)
0 siblings, 15 replies; 16+ messages in thread
From: wwwhhhyyy333 at gmail dot com @ 2021-07-09 15:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
Bug ID: 101395
Summary: Compile failure with -march=native -m32 on
sapphirerapids
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: wwwhhhyyy333 at gmail dot com
Target Milestone: ---
cat test.c
int main()
{
return 0;
}
On sapphire rapids machine,
gcc test.c -march=native -m32
will get
cc1: error: ‘-muintr’ not supported for 32-bit code
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
@ 2021-07-09 16:21 ` hjl.tools at gmail dot com
2021-07-09 16:22 ` hjl.tools at gmail dot com
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-09 16:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.2
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Assignee|unassigned at gcc dot gnu.org |hjl.tools at gmail dot com
Last reconfirmed| |2021-07-09
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
2021-07-09 16:21 ` [Bug target/101395] [11/12 regression] " hjl.tools at gmail dot com
@ 2021-07-09 16:22 ` hjl.tools at gmail dot com
2021-07-09 17:19 ` wwwhhhyyy333 at gmail dot com
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-09 16:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 51124
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51124&action=edit
A patch
Please test this patch.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
2021-07-09 16:21 ` [Bug target/101395] [11/12 regression] " hjl.tools at gmail dot com
2021-07-09 16:22 ` hjl.tools at gmail dot com
@ 2021-07-09 17:19 ` wwwhhhyyy333 at gmail dot com
2021-07-09 18:39 ` hjl.tools at gmail dot com
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: wwwhhhyyy333 at gmail dot com @ 2021-07-09 17:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
--- Comment #2 from Hongyu Wang <wwwhhhyyy333 at gmail dot com> ---
(In reply to H.J. Lu from comment #1)
> Created attachment 51124 [details]
> A patch
>
> Please test this patch.
It doesn't work.
I use ./sde-external-8.63.0-2021-01-18-lin/sde -spr -- gcc test.c -march=native
-m32 to verify it.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (2 preceding siblings ...)
2021-07-09 17:19 ` wwwhhhyyy333 at gmail dot com
@ 2021-07-09 18:39 ` hjl.tools at gmail dot com
2021-07-11 1:21 ` wwwhhhyyy333 at gmail dot com
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-09 18:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #51124|0 |1
is obsolete| |
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 51125
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51125&action=edit
An updated patch
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (3 preceding siblings ...)
2021-07-09 18:39 ` hjl.tools at gmail dot com
@ 2021-07-11 1:21 ` wwwhhhyyy333 at gmail dot com
2021-07-12 13:58 ` jakub at gcc dot gnu.org
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: wwwhhhyyy333 at gmail dot com @ 2021-07-11 1:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
--- Comment #4 from Hongyu Wang <wwwhhhyyy333 at gmail dot com> ---
(In reply to H.J. Lu from comment #3)
> Created attachment 51125 [details]
> An updated patch
This works, thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (4 preceding siblings ...)
2021-07-11 1:21 ` wwwhhhyyy333 at gmail dot com
@ 2021-07-12 13:58 ` jakub at gcc dot gnu.org
2021-07-12 15:07 ` hjl.tools at gmail dot com
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-12 13:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Wouldn't it work to instead wrap the -muintr option from local_cpu_detect into
%{m64|mx32:-muintr} or %{!m32:-muintr} depending on TARGET_64BIT_DEFAULT ?
-muintr-native is ugly...
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (5 preceding siblings ...)
2021-07-12 13:58 ` jakub at gcc dot gnu.org
@ 2021-07-12 15:07 ` hjl.tools at gmail dot com
2021-07-12 15:11 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-12 15:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #51125|0 |1
is obsolete| |
--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 51142
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51142&action=edit
A patch
Please try this.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (6 preceding siblings ...)
2021-07-12 15:07 ` hjl.tools at gmail dot com
@ 2021-07-12 15:11 ` jakub at gcc dot gnu.org
2021-07-12 15:34 ` hjl.tools at gmail dot com
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-12 15:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Comment on attachment 51142
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51142
A patch
Can't you use one single local_cpu_detect and pass it 2 arguments (arch/tune
and 32/64) instead of just one (arch/tune)?
Then you could check that second arg only for the uintr...
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (7 preceding siblings ...)
2021-07-12 15:11 ` jakub at gcc dot gnu.org
@ 2021-07-12 15:34 ` hjl.tools at gmail dot com
2021-07-12 15:53 ` hjl.tools at gmail dot com
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-12 15:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Jakub Jelinek from comment #7)
> Comment on attachment 51142 [details]
> A patch
>
> Can't you use one single local_cpu_detect and pass it 2 arguments (arch/tune
> and 32/64) instead of just one (arch/tune)?
> Then you could check that second arg only for the uintr...
I can and host_detect_local_cpu needs to parse "arch32/tune32/arch64/tune64".
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (8 preceding siblings ...)
2021-07-12 15:34 ` hjl.tools at gmail dot com
@ 2021-07-12 15:53 ` hjl.tools at gmail dot com
2021-07-13 1:45 ` wwwhhhyyy333 at gmail dot com
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-12 15:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #51142|0 |1
is obsolete| |
--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 51143
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51143&action=edit
A patch
Try this instead.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (9 preceding siblings ...)
2021-07-12 15:53 ` hjl.tools at gmail dot com
@ 2021-07-13 1:45 ` wwwhhhyyy333 at gmail dot com
2021-07-13 18:33 ` hjl.tools at gmail dot com
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: wwwhhhyyy333 at gmail dot com @ 2021-07-13 1:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
--- Comment #10 from Hongyu Wang <wwwhhhyyy333 at gmail dot com> ---
(In reply to H.J. Lu from comment #9)
> Created attachment 51143 [details]
> A patch
>
> Try this instead.
This also works.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (10 preceding siblings ...)
2021-07-13 1:45 ` wwwhhhyyy333 at gmail dot com
@ 2021-07-13 18:33 ` hjl.tools at gmail dot com
2021-07-14 12:24 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-13 18:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
--- Comment #11 from H.J. Lu <hjl.tools at gmail dot com> ---
The v3 patch is posted at
https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575102.html
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (11 preceding siblings ...)
2021-07-13 18:33 ` hjl.tools at gmail dot com
@ 2021-07-14 12:24 ` cvs-commit at gcc dot gnu.org
2021-07-15 12:31 ` cvs-commit at gcc dot gnu.org
2021-07-15 12:32 ` hjl.tools at gmail dot com
14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-14 12:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:
https://gcc.gnu.org/g:cc11b924bfe7752edbba052ca71653f46a60887a
commit r12-2296-gcc11b924bfe7752edbba052ca71653f46a60887a
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jul 9 09:16:01 2021 -0700
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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (12 preceding siblings ...)
2021-07-14 12:24 ` cvs-commit at gcc dot gnu.org
@ 2021-07-15 12:31 ` cvs-commit at gcc dot gnu.org
2021-07-15 12:32 ` hjl.tools at gmail dot com
14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-15 12:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:
https://gcc.gnu.org/g:a0128f11e9dadc3cc3ed0ad0edb36593b16f72e8
commit r11-8754-ga0128f11e9dadc3cc3ed0ad0edb36593b16f72e8
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jul 9 09:16:01 2021 -0700
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.
(cherry picked from commit cc11b924bfe7752edbba052ca71653f46a60887a)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/101395] [11/12 regression] Compile failure with -march=native -m32 on sapphirerapids
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
` (13 preceding siblings ...)
2021-07-15 12:31 ` cvs-commit at gcc dot gnu.org
@ 2021-07-15 12:32 ` hjl.tools at gmail dot com
14 siblings, 0 replies; 16+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-15 12:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101395
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #14 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for GCC 12 and 11.2.
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2021-07-15 12:32 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 15:24 [Bug target/101395] New: Compile failure with -march=native -m32 on sapphirerapids wwwhhhyyy333 at gmail dot com
2021-07-09 16:21 ` [Bug target/101395] [11/12 regression] " hjl.tools at gmail dot com
2021-07-09 16:22 ` hjl.tools at gmail dot com
2021-07-09 17:19 ` wwwhhhyyy333 at gmail dot com
2021-07-09 18:39 ` hjl.tools at gmail dot com
2021-07-11 1:21 ` wwwhhhyyy333 at gmail dot com
2021-07-12 13:58 ` jakub at gcc dot gnu.org
2021-07-12 15:07 ` hjl.tools at gmail dot com
2021-07-12 15:11 ` jakub at gcc dot gnu.org
2021-07-12 15:34 ` hjl.tools at gmail dot com
2021-07-12 15:53 ` hjl.tools at gmail dot com
2021-07-13 1:45 ` wwwhhhyyy333 at gmail dot com
2021-07-13 18:33 ` hjl.tools at gmail dot com
2021-07-14 12:24 ` cvs-commit at gcc dot gnu.org
2021-07-15 12:31 ` cvs-commit at gcc dot gnu.org
2021-07-15 12:32 ` hjl.tools at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).