public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/55307] New: libgcc's __cpu_indicator_init does not check for avx correctly
@ 2012-11-13 5:21 luto at mit dot edu
2012-11-13 14:55 ` [Bug target/55307] " hjl.tools at gmail dot com
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: luto at mit dot edu @ 2012-11-13 5:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55307
Bug #: 55307
Summary: libgcc's __cpu_indicator_init does not check for avx
correctly
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: luto@mit.edu
[this is a libgcc bug, and I haven't tested it -- the test is a PITA.]
One might expect that __builtin_cpu_supports("avx") would only return true if
avx is usable. Unfortunately, it returns true iff avx is implemented by the
cpu, regardless of whether it should be expected to work. The code should
check for osxsave and then use xgetbv to see if ymm state is available.
This is more or less the same bug as glibc bug 13007 [1]. There's an intel
blog post on the subject at [2]. It's likely to result in crashes if old
kernels are run on new hardware.
Curiously, the code in gcc/testsuite/gcc.target/i386/avx-check.h appears
correct. I suspect it's never been run with ymm state disabled.
[1] http://sourceware.org/bugzilla/show_bug.cgi?id=13007
[2] http://software.intel.com/en-us/blogs/2011/04/14/is-avx-enabled/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/55307] libgcc's __cpu_indicator_init does not check for avx correctly
2012-11-13 5:21 [Bug other/55307] New: libgcc's __cpu_indicator_init does not check for avx correctly luto at mit dot edu
@ 2012-11-13 14:55 ` hjl.tools at gmail dot com
2013-03-22 14:48 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: hjl.tools at gmail dot com @ 2012-11-13 14:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55307
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-11-13
Component|other |target
CC| |areg.melikadamyan at gmail
| |dot com, hjl.tools at gmail
| |dot com
Ever Confirmed|0 |1
Target Milestone|--- |4.8.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/55307] libgcc's __cpu_indicator_init does not check for avx correctly
2012-11-13 5:21 [Bug other/55307] New: libgcc's __cpu_indicator_init does not check for avx correctly luto at mit dot edu
2012-11-13 14:55 ` [Bug target/55307] " hjl.tools at gmail dot com
@ 2013-03-22 14:48 ` jakub at gcc dot gnu.org
2013-05-31 10:59 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-22 14:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55307
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.0 |4.8.1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-22 14:45:13 UTC ---
GCC 4.8.0 is being released, adjusting target milestone.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/55307] libgcc's __cpu_indicator_init does not check for avx correctly
2012-11-13 5:21 [Bug other/55307] New: libgcc's __cpu_indicator_init does not check for avx correctly luto at mit dot edu
2012-11-13 14:55 ` [Bug target/55307] " hjl.tools at gmail dot com
2013-03-22 14:48 ` jakub at gcc dot gnu.org
@ 2013-05-31 10:59 ` jakub at gcc dot gnu.org
2013-10-16 9:51 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-31 10:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55307
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.1 |4.8.2
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.1 has been released.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/55307] libgcc's __cpu_indicator_init does not check for avx correctly
2012-11-13 5:21 [Bug other/55307] New: libgcc's __cpu_indicator_init does not check for avx correctly luto at mit dot edu
` (2 preceding siblings ...)
2013-05-31 10:59 ` jakub at gcc dot gnu.org
@ 2013-10-16 9:51 ` jakub at gcc dot gnu.org
2015-06-22 14:25 ` rguenth at gcc dot gnu.org
2015-08-19 17:04 ` noloader at gmail dot com
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-10-16 9:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55307
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.2 |4.8.3
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.2 has been released.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/55307] libgcc's __cpu_indicator_init does not check for avx correctly
2012-11-13 5:21 [Bug other/55307] New: libgcc's __cpu_indicator_init does not check for avx correctly luto at mit dot edu
` (3 preceding siblings ...)
2013-10-16 9:51 ` jakub at gcc dot gnu.org
@ 2015-06-22 14:25 ` rguenth at gcc dot gnu.org
2015-08-19 17:04 ` noloader at gmail dot com
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-22 14:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55307
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.3 |---
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/55307] libgcc's __cpu_indicator_init does not check for avx correctly
2012-11-13 5:21 [Bug other/55307] New: libgcc's __cpu_indicator_init does not check for avx correctly luto at mit dot edu
` (4 preceding siblings ...)
2015-06-22 14:25 ` rguenth at gcc dot gnu.org
@ 2015-08-19 17:04 ` noloader at gmail dot com
5 siblings, 0 replies; 7+ messages in thread
From: noloader at gmail dot com @ 2015-08-19 17:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55307
Jeffrey Walton <noloader at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |noloader at gmail dot com
--- Comment #4 from Jeffrey Walton <noloader at gmail dot com> ---
Forgive my ignorance... Is __builtin_cpu_supports really __builtin_os_supports?
If we want to test CPU support (rather than OS support), then can it be done
with the built-ins?
Also, the documentation at
https://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/X86-Built-in-Functions.html does
not mention that this is in fact OS support, and not CPU support.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-08-19 17:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-13 5:21 [Bug other/55307] New: libgcc's __cpu_indicator_init does not check for avx correctly luto at mit dot edu
2012-11-13 14:55 ` [Bug target/55307] " hjl.tools at gmail dot com
2013-03-22 14:48 ` jakub at gcc dot gnu.org
2013-05-31 10:59 ` jakub at gcc dot gnu.org
2013-10-16 9:51 ` jakub at gcc dot gnu.org
2015-06-22 14:25 ` rguenth at gcc dot gnu.org
2015-08-19 17:04 ` noloader 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).