svn commit: r275036 - in stable: 10/contrib/binutils/gas/config 9/contrib/binutils/gas/config

Dimitry Andric dim at FreeBSD.org
Tue Nov 25 12:58:22 UTC 2014


Author: dim
Date: Tue Nov 25 12:58:21 2014
New Revision: 275036
URL: https://svnweb.freebsd.org/changeset/base/275036

Log:
  MFC r274856:
  
  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

Modified:
  stable/10/contrib/binutils/gas/config/tc-arm.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/contrib/binutils/gas/config/tc-arm.c
Directory Properties:
  stable/9/contrib/binutils/   (props changed)

Modified: stable/10/contrib/binutils/gas/config/tc-arm.c
==============================================================================
--- stable/10/contrib/binutils/gas/config/tc-arm.c	Tue Nov 25 12:52:00 2014	(r275035)
+++ stable/10/contrib/binutils/gas/config/tc-arm.c	Tue Nov 25 12:58:21 2014	(r275036)
@@ -6062,7 +6062,7 @@ parse_operands (char *str, const unsigne
 
 /* 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.  */


More information about the svn-src-stable-10 mailing list