From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43612 invoked by alias); 17 May 2016 12:37:57 -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 43590 invoked by uid 89); 17 May 2016 12:37:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=psi, held X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 17 May 2016 12:37:55 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C48847F09B; Tue, 17 May 2016 12:37:54 +0000 (UTC) Received: from [10.36.4.5] (vpn1-4-5.ams2.redhat.com [10.36.4.5]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4HCbqfS002809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 May 2016 08:37:53 -0400 Subject: Re: RFA: Generate normal DWARF DW_LOC descriptors for non integer mode pointers To: Jeff Law , gcc-patches@gcc.gnu.org References: <87h9dyt7m3.fsf@redhat.com> <1c7da1c8-c088-6c35-dbc8-bacebd4ad4d0@redhat.com> Cc: gdb-patches@sourceware.org From: Nick Clifton Message-ID: <344916c2-c8d0-9a4b-1fc4-0b8035276ea6@redhat.com> Date: Tue, 17 May 2016 12:37:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1c7da1c8-c088-6c35-dbc8-bacebd4ad4d0@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-05/txt/msg00256.txt.bz2 Hi Jeff, >> Currently dwarf2out.c:mem_loc_descriptor() has some special case >> code to handle the situation where an address is held in a register >> whose mode is not of type MODE_INT. It generates a >> DW_OP_GNU_regval_type expression which may later on be converted into >> a frame pointer based expression. This is a problem for targets which >> use a partial integer mode for their pointers (eg the msp430). In >> such cases the conversion to a frame pointer based expression could >> be wrong if the frame pointer is not being used. > I may be missing something, but isn't it the transition to an FP > relative address rather than a SP relative address that's the problem > here? Yes, I believe so. > Where does that happen? I did not track it down. But whilst I was searching for the cause I came across the code that is modified by the patch. Reading the code it seemed obvious to me that the special case for handling non INT_MODE register modes was not intended for pointers, and when I tried out a small patch it worked. > Is it possible we've got the wrong DECL_RTL or somesuch? I don't think so. I am not familiar with this code myself, but the dump from the dwarf2 pass shows: (insn 5 2 6 (set (mem/c:HI (plus:PSI (reg/f:PSI 1 R1) (const_int 4 [0x4])) [1 c+0 S2 A16]) (const_int 5 [0x5])) /work/sources/binutils/current/gdb/testsuite/gdb.base/advance.c:41 12 {movhi} (nil)) which to me pretty clearly shows that "c" is being stored at R1+4. Cheers Nick