+2014-11-20 Richard Earnshaw <rearnsha@arm.com>
+
+ * config/tc-arm.c (rotate_left): Avoid undefined behaviour when
+ N = 0.
+
2014-11-20 Richard Earnshaw <rearnsha@arm.com>
* config/tc-aarch64.c (warn_unpredictable_ldst): Check that transfer
/* Functions for operand encoding. ARM, then Thumb. */
-#define rotate_left(v, n) (v << n | v >> (32 - n))
+#define rotate_left(v, n) (v << (n & 31) | v >> ((32 - n) & 31))
/* If VAL can be encoded in the immediate field of an ARM instruction,
return the encoded form. Otherwise, return FAIL. */