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:
Dimitry Andric 2014-11-22 16:30:31 +00:00
parent 08dc8cf90c
commit 5008830b51
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274856

View File

@ -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. */