Pull in r175360 from upstream llvm trunk:
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. MFC after: 3 days
This commit is contained in:
parent
d2a99d8189
commit
953290ffde
@ -2372,6 +2372,10 @@ bool AsmParser::ParseDirectiveAlign(bool IsPow2, unsigned ValueSize) {
|
||||
}
|
||||
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user