1
0
mirror of https://github.com/skeeto/w64devkit.git synced 2025-04-18 06:44:01 +03:00

gcc: Patch misaligned AVX spills (GCC bug 54412)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
This commit is contained in:
Christopher Wellons 2025-02-17 18:40:46 -05:00
parent 05d3306ca2
commit 36ac343fc3
2 changed files with 16 additions and 5 deletions

View File

@ -183,10 +183,6 @@ ported to Mingw-w64][san] ([also][san2]), but Undefined Behavior Sanitizer
`-fsanitize-trap`, GDB will [break precisely][break] on undefined
behavior, and it does not require linking with libsanitizer.
[GCC does not fully support AVX on Windows][avx] and may use aligned moves
on unaligned addresses. When targeting AVX, consider disabling all aligned
moves in the assembler: `-Wa,-muse-unaligned-vector-move`.
## Licenses
When distributing binaries built using w64devkit, your .exe will include
@ -201,7 +197,6 @@ w64devkit includes the concatenated set of all licenses in the file
binaries.
[avx]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
[bb]: https://frippery.org/busybox/
[break]: https://nullprogram.com/blog/2022/06/26/
[bs]: https://www.rdegges.com/2016/i-dont-give-a-shit-about-licensing/

View File

@ -0,0 +1,16 @@
Treat AVX register spills as always unaligned, eliminating the
requirement for -Wa,-muse-unaligned-vector-move when targeting
AVX-capable hardware.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -1695,5 +1695,6 @@
(define_predicate "misaligned_operand"
(and (match_code "mem")
- (match_test "MEM_ALIGN (op) < GET_MODE_BITSIZE (mode)")))
+ (ior (match_test "MEM_SIZE (op) > 16")
+ (match_test "MEM_ALIGN (op) < GET_MODE_BITSIZE (mode)"))))
;; Return true if OP is a parallel for an mov{d,q,dqa,ps,pd} vec_select,