Date: Tue, 25 Nov 2014 12:58:21 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275036 - in stable: 10/contrib/binutils/gas/config 9/contrib/binutils/gas/config Message-ID: <201411251258.sAPCwLJh047044@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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/9/contrib/binutils/gas/config/tc-arm.c Directory Properties: stable/9/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/gas/config/tc-arm.c Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- stable/9/contrib/binutils/gas/config/tc-arm.c Tue Nov 25 12:52:00 2014 (r275035) +++ stable/9/contrib/binutils/gas/config/tc-arm.c Tue Nov 25 12:58:21 2014 (r275036) @@ -6057,7 +6057,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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411251258.sAPCwLJh047044>