From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7482 invoked by alias); 12 May 2011 19:32:49 -0000 Received: (qmail 7386 invoked by uid 22791); 12 May 2011 19:32:48 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 May 2011 19:32:34 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4CJWVKr016637 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 May 2011 15:32:32 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4CJWVi0032421; Thu, 12 May 2011 15:32:31 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p4CJWUPL030316; Thu, 12 May 2011 15:32:30 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 2768A37848C; Thu, 12 May 2011 13:32:30 -0600 (MDT) From: Tom Tromey To: "Ulrich Weigand" Cc: gdb-patches@sourceware.org Subject: Re: RFC: implement typed DWARF stack References: <201105110015.p4B0FPSB032445@d06av02.portsmouth.uk.ibm.com> Date: Thu, 12 May 2011 19:32:00 -0000 In-Reply-To: <201105110015.p4B0FPSB032445@d06av02.portsmouth.uk.ibm.com> (Ulrich Weigand's message of "Wed, 11 May 2011 02:15:25 +0200 (CEST)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 X-SW-Source: 2011-05/txt/msg00311.txt.bz2 >>>>> "Ulrich" == Ulrich Weigand writes: Tom> Yes. My understanding is that for new-style typed values, DW_OP_shr and Tom> DW_OP_shra are actually the same -- the type indicates the operation to Tom> perform. But, for old-style values, we must cast to unsigned for Tom> DW_OP_shr. Ulrich> I see. However, the code as implemented casts *all* signed values to Ulrich> unsigned for DW_OP_shr, not just old-style values. That's what got Ulrich> me confused ... I mentioned this on the GCC list and Jakub said that GCC actually emits code assuming that the operation will always be unsigned. So, I am reverting my change here. Patch appended. Tom 2011-05-12 Tom Tromey * dwarf2expr.c (execute_stack_op) : Unconditionally cast left-hand-side to unsigned. Index: dwarf2expr.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2expr.c,v retrieving revision 1.58 diff -u -r1.58 dwarf2expr.c --- dwarf2expr.c 12 May 2011 17:40:54 -0000 1.58 +++ dwarf2expr.c 12 May 2011 19:28:28 -0000 @@ -979,7 +979,7 @@ case DW_OP_shr: dwarf_require_integral (value_type (first)); dwarf_require_integral (value_type (second)); - if (value_type (first) == address_type) + if (!TYPE_UNSIGNED (value_type (first))) { struct type *utype = get_unsigned_type (ctx->gdbarch, value_type (first));