mirror of
https://git.freebsd.org/ports.git
synced 2025-06-29 16:40:31 -04:00
base version: r170353: Fix another SROA crasher, PR14601. This was a silly oversight, we weren't pruning allocas which were used by variable-length memory intrinsics from the set that could be widened and promoted as integers. Fix that. r175057: X86: Disable generation of rep;movsl when %esi is used as a base pointer. This happens when there is both stack realignment and a dynamic alloca in the function. If we overwrite %esi (rep;movsl uses fixed registers) we'll lose the base pointer and the next register spill will write into oblivion. Fixes PR15249 and unbreaks firefox on i386/freebsd. Mozilla uses dynamic allocas and freebsd a 4 byte stack alignment. r175360: MCParser: Reject .balign with non-pow2 alignments. GNU as rejects them and there are configure scripts in the wild that check if the assembler rejects ".align 3" to determine whether the alignment is in bytes or powers of two. r175962: X86: Disable cmov-memory patterns on subtargets without cmov. PR: ports/176269, ports/176893, ports/176967 Requested by: tijl, dim, others
40 lines
1.5 KiB
Text
40 lines
1.5 KiB
Text
$FreeBSD$
|
|
------------------------------------------------------------------------
|
|
r175360 | d0k | 2013-02-16 15:00:16 +0000 (Sat, 16 Feb 2013) | 5 lines
|
|
|
|
MCParser: Reject .balign with non-pow2 alignments.
|
|
|
|
GNU as rejects them and there are configure scripts in the wild that check if
|
|
the assembler rejects ".align 3" to determine whether the alignment is in bytes
|
|
or powers of two.
|
|
------------------------------------------------------------------------
|
|
Index: lib/MC/MCParser/AsmParser.cpp
|
|
===================================================================
|
|
--- lib/MC/MCParser/AsmParser.cpp (revision 175359)
|
|
+++ lib/MC/MCParser/AsmParser.cpp (revision 175360)
|
|
@@ -2456,6 +2456,10 @@
|
|
}
|
|
|
|
Alignment = 1ULL << Alignment;
|
|
+ } else {
|
|
+ // Reject alignments that aren't a power of two, for gas compatibility.
|
|
+ if (!isPowerOf2_64(Alignment))
|
|
+ Error(AlignmentLoc, "alignment must be a power of 2");
|
|
}
|
|
|
|
// Diagnose non-sensical max bytes to align.
|
|
Index: test/MC/AsmParser/align_invalid.s
|
|
===================================================================
|
|
--- test/MC/AsmParser/align_invalid.s (revision 0)
|
|
+++ test/MC/AsmParser/align_invalid.s (revision 175360)
|
|
@@ -0,0 +1,10 @@
|
|
+# RUN: llvm-mc -triple i386-linux-gnu < %s 2>&1 | FileCheck %s -check-prefix=ELF
|
|
+# RUN: llvm-mc -triple i386-apple-darwin < %s 2>&1 | FileCheck %s -check-prefix=DARWIN
|
|
+
|
|
+.align 3
|
|
+# ELF: error: alignment must be a power of 2
|
|
+# DARWIN-NOT: error
|
|
+
|
|
+.align 32
|
|
+# ELF-NOT: error
|
|
+# DARWIN: error: invalid alignment value
|