From patchwork Sat Sep 5 08:05:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 8584 Received: (qmail 49032 invoked by alias); 5 Sep 2015 08:06:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 48986 invoked by uid 89); 5 Sep 2015 08:06:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.3 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RCVD_IN_JMF_BL, RCVD_IN_PSBL, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: 21cn.com Received: from smtpfree.forptr.21cn.com (HELO 21cn.com) (183.56.131.114) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 05 Sep 2015 08:06:17 +0000 HMM_SOURCE_IP: 10.64.8.32:64055.816105773 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from localhost.localdomain (unknown [10.64.8.32]) by 21cn.com (HERMES) with ESMTP id 37A9930781E2; Sat, 5 Sep 2015 16:06:11 +0800 (CST) Received: from localhost.localdomain ([124.166.242.182]) by zm-as2(MEDUSA 0.0.0.0) with ESMTP id de6ef692-c50d-4c27-b529-dbcce2368e24 for binutils@sourceware.org; Sat Sep 5 16:06:13 2015 0/X-Total-Score: 0: 1/X-Total-Score: 0: X-FILTER-SCORE: to=<838a8f96958a8d9461949096938486988293864f909388>, score=<1441440373MM+M12+DKLNORMMMMM1MM2GGTGTGTGTGTGTGGGGGTGGG> X-REAL-FROM: gchen_5i5j@21cn.com X-Receive-IP: 124.166.242.182 From: gang.chen.5i5j@gmail.com To: binutils@sourceware.org, gdb-patches@sourceware.org Cc: xili_gchen_5257@hotmail.com, Chen Gang Subject: [PATCH] config/tc-avr.c (md_section_align): Append UL for -1 to avoid the latest gcc's warning Date: Sat, 5 Sep 2015 16:05:16 +0800 Message-Id: <1441440316-23667-1-git-send-email-gang.chen.5i5j@gmail.com> MIME-Version: 1.0 From: Chen Gang The related warning is: gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/gas -I. -I../../binutils-gdb/gas -I../bfd -I../../binutils-gdb/gas/config -I../../binutils-gdb/gas/../include -I../../binutils-gdb/gas/.. -I../../binutils-gdb/gas/../bfd -DLOCALEDIR="\"/upstream/release-avr32/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I../../binutils-gdb/gas/../zlib -g -O2 -MT tc-avr.o -MD -MP -MF .deps/tc-avr.Tpo -c -o tc-avr.o `test -f 'config/tc-avr.c' || echo '../../binutils-gdb/gas/'`config/tc-avr.c ../../binutils-gdb/gas/config/tc-avr.c: In function ‘md_section_align’: ../../binutils-gdb/gas/config/tc-avr.c:1233:43: error: left shift of negative value [-Werror=shift-negative-value] return ((addr + (1 << align) - 1) & (-1 << align)); ^ 2015-09-05 Chen Gang * config/tc-avr.c (md_section_align): Append UL for -1 to avoid the latest gcc's warning. --- gas/ChangeLog | 5 +++++ gas/config/tc-avr.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 2dc9742..c0fb096 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2015-09-05 Chen Gang + + * config/tc-avr.c (md_section_align): Append UL for -1 to avoid + the latest gcc's warning. + 2015-08-27 Alan Modra PR gas/18581 diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c index c69a91c..09eea48 100644 --- a/gas/config/tc-avr.c +++ b/gas/config/tc-avr.c @@ -1230,7 +1230,7 @@ valueT md_section_align (asection *seg, valueT addr) { int align = bfd_get_section_alignment (stdoutput, seg); - return ((addr + (1 << align) - 1) & (-1 << align)); + return ((addr + (1 << align) - 1) & (-1UL << align)); } /* If you define this macro, it should return the offset between the