From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110372 invoked by alias); 10 Nov 2015 11:18:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 110358 invoked by uid 89); 10 Nov 2015 11:18:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e06smtp17.uk.ibm.com Received: from e06smtp17.uk.ibm.com (HELO e06smtp17.uk.ibm.com) (195.75.94.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 10 Nov 2015 11:18:15 +0000 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Nov 2015 11:18:12 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 10 Nov 2015 11:17:59 -0000 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: vogt@linux.vnet.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 552E317D80B5 for ; Tue, 10 Nov 2015 11:18:11 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAABHrxN31785012 for ; Tue, 10 Nov 2015 11:17:53 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAAAHspZ017663 for ; Tue, 10 Nov 2015 03:17:54 -0700 Received: from bl3ahm9f.de.ibm.com (dyn-9-152-212-186.boeblingen.de.ibm.com [9.152.212.186]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tAAAHrxx017652 for ; Tue, 10 Nov 2015 03:17:53 -0700 Received: from dvogt by bl3ahm9f.de.ibm.com with local (Exim 4.76) (envelope-from ) id 1Zw6vw-0004g3-7X; Tue, 10 Nov 2015 12:17:52 +0100 Date: Tue, 10 Nov 2015 11:18:00 -0000 From: Dominik Vogt To: gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] Fix invalid left shift of negative value. Message-ID: <20151110111752.GF17214@linux.vnet.ibm.com> Reply-To: vogt@linux.vnet.ibm.com References: <20151110111638.GD17214@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Ycz6tD7Th1CMF4v7" Content-Disposition: inline In-Reply-To: <20151110111638.GD17214@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15111011-0029-0000-0000-00000906B6BF X-SW-Source: 2015-11/txt/msg00254.txt.bz2 --Ycz6tD7Th1CMF4v7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 408 On Tue, Nov 10, 2015 at 12:16:38PM +0100, Dominik Vogt wrote: > The following series of patches fixes all occurences of > left-shifting negative constants in C code which is undefined by > the C standard. The patches have been tested on s390x, covering > only a small subset of the changes. Changes in gdb/testsuite/. Not sure whether they are good. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany --Ycz6tD7Th1CMF4v7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0002-gdb-testsuite-Fix-left-shift-of-negative-value.patch" Content-length: 1936 >From d1cbc6f371e2720fe4bf4975d8ad9c81a9f01351 Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Fri, 30 Oct 2015 15:18:06 +0100 Subject: [PATCH 2/2] gdb/testsuite: Fix left shift of negative value. This patch fixes all occurences of left-shifting negative constants in C cod which is undefined by the C standard. gdb/testsuite/ChangeLog: * lib/dwarf.exp (_note): Fix left shift of negative value. * gdb.trace/trace-condition.exp: Likewise. --- gdb/testsuite/gdb.trace/trace-condition.exp | 2 +- gdb/testsuite/lib/dwarf.exp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp index aec0401..46fa5ed 100644 --- a/gdb/testsuite/gdb.trace/trace-condition.exp +++ b/gdb/testsuite/gdb.trace/trace-condition.exp @@ -152,7 +152,7 @@ foreach trace_command { "trace" "ftrace" } { test_tracepoints $trace_command "21 * 2 == 42" 10 test_tracepoints $trace_command "21 << 1 == 42" 10 test_tracepoints $trace_command "42 >> 1 == 21" 10 - test_tracepoints $trace_command "-21 << 1 == -42" 10 + test_tracepoints $trace_command "-(21 << 1) == -42" 10 test_tracepoints $trace_command "-42 >> 1 == -21" 10 test_tracepoints $trace_command "(0xabababab & 0x0000ffff) == 0xabab" 10 test_tracepoints $trace_command "(0xabababab | 0x0000ffff) == 0xababffff" 10 diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 9716795..c87da87 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -1289,7 +1289,7 @@ namespace eval Dwarf { _op .ascii [_quote $name] # Alignment. set align 2 - set total [expr {($namelen + (1 << $align) - 1) & (-1 << $align)}] + set total [expr {($namelen + (1 << $align) - 1) & -(1 << $align)}] for {set i $namelen} {$i < $total} {incr i} { _op .byte 0 } -- 2.3.0 --Ycz6tD7Th1CMF4v7--