Avoid undefined behaviour in gas's rotate_left() macro for n == 0.
Otherwise, clang can effectively remove the first iteration of the for loops where this macro is invoked, and as a result, "cmp r0, #99" fails to assemble. Obtained from: joerg at netbsd MFC after: 3 days
This commit is contained in:
parent
08dc8cf90c
commit
5008830b51
@ -6079,7 +6079,7 @@ parse_operands (char *str, const unsigned char *pattern)
|
||||
|
||||
/* Functions for operand encoding. ARM, then Thumb. */
|
||||
|
||||
#define rotate_left(v, n) (v << n | v >> (32 - n))
|
||||
#define rotate_left(v, n) (v << (n % 32) | v >> ((32 - n) % 32))
|
||||
|
||||
/* If VAL can be encoded in the immediate field of an ARM instruction,
|
||||
return the encoded form. Otherwise, return FAIL. */
|
||||
|
Loading…
Reference in New Issue
Block a user