From patchwork Wed Jul 28 15:51:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 60157 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 78F5AB6EFF for ; Thu, 29 Jul 2010 01:49:38 +1000 (EST) Received: (qmail 26561 invoked by alias); 28 Jul 2010 15:49:37 -0000 Received: (qmail 26549 invoked by uid 22791); 28 Jul 2010 15:49:35 -0000 X-SWARE-Spam-Status: No, hits=-6.1 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; Wed, 28 Jul 2010 15:49:28 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6SFnQHo007041 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 28 Jul 2010 11:49:26 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6SFnPnR011149 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 28 Jul 2010 11:49:26 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id o6SFpr0G009055; Wed, 28 Jul 2010 17:51:53 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id o6SFprBW009053; Wed, 28 Jul 2010 17:51:53 +0200 Date: Wed, 28 Jul 2010 17:51:52 +0200 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Don't ignore VAR_LOCATION notes that affect last tail call in the function (PR debug/45103) Message-ID: <20100728155152.GA18378@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi! In dwarf2out_var_location we drop on the floor VAR_LOCATION notes after last real insn in the function, because there are no instructions it would affect. That is wrong for NOTE_DURING_CALL_P notes (which in this case can exist just in functions ending with a noreturn call), because NOTE_DURING_CALL_P notes affect also the time spent in the call. If say some variable in a function doing the noreturn call lives in a call clobbered register, we thus pretend it is live even during the call (which is not true, it is certainly live only up to the call insn itself, but once it enters the other function, it might be already clobbered). Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux. Ok for trunk? 2010-07-28 Jakub Jelinek PR debug/45103 * dwarf2out.c (dwarf2out_var_location): Always consider NOTE_DURING_CALL_P notes, even when not followed by real instructions. Jakub --- gcc/dwarf2out.c.jj 2010-07-28 10:36:00.000000000 +0200 +++ gcc/dwarf2out.c 2010-07-28 11:44:24.000000000 +0200 @@ -21278,7 +21278,7 @@ dwarf2out_var_location (rtx loc_note) next_real = next_real_insn (loc_note); /* If there are no instructions which would be affected by this note, don't do anything. */ - if (next_real == NULL_RTX) + if (next_real == NULL_RTX && !NOTE_DURING_CALL_P (loc_note)) return; /* If there were any real insns between note we processed last time