From patchwork Sat Sep 5 10:30:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 8585 Received: (qmail 99266 invoked by alias); 5 Sep 2015 10:30:38 -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 99240 invoked by uid 89); 5 Sep 2015 10:30:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.3 required=5.0 tests=AWL, BAYES_50, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: COL004-OMC2S7.hotmail.com Received: from col004-omc2s7.hotmail.com (HELO COL004-OMC2S7.hotmail.com) (65.55.34.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Sat, 05 Sep 2015 10:30:34 +0000 Received: from COL130-W59 ([65.55.34.73]) by COL004-OMC2S7.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sat, 5 Sep 2015 03:30:32 -0700 X-TMN: [qXNadwWdNyfXouHXX1ZHRhHfeIXLidwn] Message-ID: From: Chen Gang To: "binutils@sourceware.org" , "gdb-patches@sourceware.org" 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 18:30:32 +0800 MIME-Version: 1.0 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(-) --  1.9.3 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