From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 691 invoked by alias); 16 May 2011 15:50:24 -0000 Received: (qmail 678 invoked by uid 22791); 16 May 2011 15:50:23 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate1.uk.ibm.com (HELO mtagate1.uk.ibm.com) (194.196.100.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 May 2011 15:50:08 +0000 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p4GFo7kC003271 for ; Mon, 16 May 2011 15:50:07 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p4GFo65H2457718 for ; Mon, 16 May 2011 16:50:06 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p4GFo6WC014771 for ; Mon, 16 May 2011 09:50:06 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p4GFo5hk014748; Mon, 16 May 2011 09:50:05 -0600 Message-Id: <201105161550.p4GFo5hk014748@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 16 May 2011 17:50:05 +0200 Subject: Re: RFC: implement typed DWARF stack To: tromey@redhat.com (Tom Tromey) Date: Mon, 16 May 2011 15:50:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: from "Tom Tromey" at May 12, 2011 01:32:30 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00359.txt.bz2 Tom Tromey wrote: > >>>>> "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. So just to clarify: in the discussion a while back, you said: > Ulrich> B.t.w. your patch always performs an unsigned shift for > Ulrich> DW_OP_shr, even on signed operands. However, for DW_OP_shra, > Ulrich> your patch respects the sign of the operands and might actually > Ulrich> perform an unsigned shift (even though the opcode explicitly > Ulrich> says "arithmetic right shift" ...) This looks like another of > Ulrich> those signed/unsigned inconsistencies with the proposal to me. > > Yes. My understanding is that for new-style typed values, DW_OP_shr and > DW_OP_shra are actually the same -- the type indicates the operation to > perform. But, for old-style values, we must cast to unsigned for > DW_OP_shr. With this latest patch, it is now definitely *not* the case that DW_OP_shr and DW_OP_shra behave the same on new-style typed values. Instead, as I pointed out originally, DW_OP_shr now always performs an unsigned operation, while DW_OP_shra respects the value's type ... Is that really what was intended? Or should rather DW_OP_shra now also be changed (to always perform a signed operation as its name suggests)? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com