From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7686 invoked by alias); 10 Oct 2006 20:25:50 -0000 Received: (qmail 7678 invoked by uid 22791); 10 Oct 2006 20:25:50 -0000 X-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Oct 2006 20:25:42 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k9AKPeX8000661 for ; Tue, 10 Oct 2006 16:25:40 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k9AKPdtq005008; Tue, 10 Oct 2006 16:25:40 -0400 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id k9AKPdY7010046; Tue, 10 Oct 2006 16:25:39 -0400 Received: from ton.toronto.redhat.com (ton.toronto.redhat.com [172.16.14.15]) by touchme.toronto.redhat.com (Postfix) with ESMTP id D9601800002; Tue, 10 Oct 2006 16:25:38 -0400 (EDT) Received: from ton.toronto.redhat.com (localhost.localdomain [127.0.0.1]) by ton.toronto.redhat.com (8.13.1/8.13.1) with ESMTP id k9AKPcct011018; Tue, 10 Oct 2006 16:25:38 -0400 Received: (from fche@localhost) by ton.toronto.redhat.com (8.13.1/8.13.1/Submit) id k9AKPc9H011015; Tue, 10 Oct 2006 16:25:38 -0400 X-Authentication-Warning: ton.toronto.redhat.com: fche set sender to fche@redhat.com using -f To: Roland McGrath Cc: Mike Mason , systemtap@sources.redhat.com Subject: Re: Problem with 32-bit negative return values References: <20061010175159.GH14473@redhat.com> <20061010182831.CA3B7180066@magilla.sf.frob.com> From: fche@redhat.com (Frank Ch. Eigler) Date: Tue, 10 Oct 2006 20:25:00 -0000 In-Reply-To: <20061010182831.CA3B7180066@magilla.sf.frob.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q4/txt/msg00070.txt.bz2 Roland McGrath writes: > All loc2c-generated fetches use unsigned types of the target object > size, i.e. uint32_t here. loc2c just fetches the bits. Your > general expression code that uses the fetched value should cast > appropriately for the signedness and size you want to calculate > with. D'oh. This bug probably affects every access to values of other than native sizeof(long) bit size. The loc2c c_translate_fetch/store functions assign to a given value name (e.g. THIS->__retvalue). Instead it seems necessary to use a temporary value, fetch into that, then emit the needed casting. - FChE