From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114611 invoked by alias); 16 Apr 2015 23:45:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 114594 invoked by uid 89); 16 Apr 2015 23:45:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 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; Thu, 16 Apr 2015 23:45:20 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3GNjJpb026410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 16 Apr 2015 19:45:19 -0400 Received: from tucnak.zalov.cz (ovpn-116-37.ams2.redhat.com [10.36.116.37]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3GNjHYv026543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Apr 2015 19:45:18 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t3GNjFba006297; Fri, 17 Apr 2015 01:45:15 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t3GNjEKA006296; Fri, 17 Apr 2015 01:45:14 +0200 Date: Thu, 16 Apr 2015 23:45:00 -0000 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Improve debug info generation for TLS + const (PR debug/65771) Message-ID: <20150416234514.GH1725@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20150416211106.GG1725@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150416211106.GG1725@tucnak.redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00843.txt.bz2 On Thu, Apr 16, 2015 at 11:11:06PM +0200, Jakub Jelinek wrote: > during expansion we get the a[D#2].t added as MEM_EXPR of a MEM, and because > we can't mem_loc_descriptor that MEM (I'll post separately a trunk only > patch that fixes that in this case, but generally not all MEMs can be > represented in debug info), we try harder and try to use MEM_EXPR in Here is the patch for it, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? We handle TLS SYMBOL_REFs in mem_loc_descriptor, but in the testcase it is surrounded by (const (plus (symbol_ref) (const_int))). 2015-04-16 Jakub Jelinek PR debug/65771 * dwarf2out.c (mem_loc_descriptor): For CONST, fallback to trying mem_loc_descriptor on XEXP (rtl, 0). --- gcc/dwarf2out.c.jj 2015-02-26 16:37:09.000000000 +0100 +++ gcc/dwarf2out.c 2015-04-16 16:45:44.584429608 +0200 @@ -12799,7 +12799,12 @@ mem_loc_descriptor (rtx rtl, machine_mod } if (!const_ok_for_output (rtl)) - break; + { + if (GET_CODE (rtl) == CONST) + mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode, + initialized); + break; + } symref: mem_loc_result = new_addr_loc_descr (rtl, dtprel_false); Jakub