From owner-svn-src-all@FreeBSD.ORG  Tue Nov 25 12:58:21 2014
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E737CD8C;
 Tue, 25 Nov 2014 12:58:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D26236A7;
 Tue, 25 Nov 2014 12:58:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAPCwLa2047045;
 Tue, 25 Nov 2014 12:58:21 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAPCwLJh047044;
 Tue, 25 Nov 2014 12:58:21 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201411251258.sAPCwLJh047044@svn.freebsd.org>
X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Tue, 25 Nov 2014 12:58:21 +0000 (UTC)
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
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.18-1
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 25 Nov 2014 12:58:22 -0000

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