From patchwork Wed Feb 8 19:32:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 140196 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 8865DB6FA0 for ; Thu, 9 Feb 2012 06:32:57 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1329334378; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=MJhHnM0RBO6wx2+NFi0d 01do39A=; b=hEYZfpkcfjLxXodkTun2Mnja/6p1GMeavqLmaQrfDyPo920Q7d0F oRXARIHJnpr+2TKW+i9CzWyV+veGaLJQefs2NMYvgOwoVGqK3kFKtxkUI/wW4FUw N7Co7hbv5DKJmnI4WS7V1NhdWbC6m619SVL5ZnvOg6iOuUQQX7+tbUU= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=tifbQ6b8BSCtKvw5gxXSdaJDLxAqMErw40JX6bPOoV5bkiNtEF2V7G6Z6HZAMn 37PQDFC0tErpPVIb7rbuoELI2msWY1ERVOyLjQtWJonxSvsiyRrntpZQAJcez1n9 CVAakfK1E7SFNZ45ToFBo6ghZA05bsM7xdfbEaZMMtcak=; Received: (qmail 2252 invoked by alias); 8 Feb 2012 19:32:52 -0000 Received: (qmail 2237 invoked by uid 22791); 8 Feb 2012 19:32:50 -0000 X-SWARE-Spam-Status: No, hits=-6.7 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, 08 Feb 2012 19:32:19 +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 q18JWJ6T020008 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 8 Feb 2012 14:32:19 -0500 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q18JWIMJ017022 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 8 Feb 2012 14:32:18 -0500 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 q18JWH46006586 for ; Wed, 8 Feb 2012 20:32:17 +0100 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id q18JWGDI006585 for gcc-patches@gcc.gnu.org; Wed, 8 Feb 2012 20:32:16 +0100 Date: Wed, 8 Feb 2012 20:32:16 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix var-tracking /c vs. non-/c note emitting (PR debug/52165) Message-ID: <20120208193216.GN18768@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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! emit_note_insn_var_location already had code to ensure that non-NOTE_DURING_CALL_P notes emitted EMIT_NOTE_BEFORE_INSN with NEXT_INSN (call_insn) are put after all the NOTE_DURING_CALL_P notes after the call, but if there is NOTE_INSN_CALL_ARG_LOCATION note there too, this code doesn't trigger and we would emit a non-NOTE_DURING_CALL_P note before NOTE_INSN_CALL_ARG_LOCATION note possibly followed by NOTE_DURING_CALL_P notes. That then may trigger ICEs in dwarf2out, which assumes that the LVL labels change monotonically, and that for calls first come all .LVLXXX-1 labels (if any) and then .LVLXXX (if any). Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux and with go cross to s390x-linux. Ok for trunk? 2012-02-08 Jakub Jelinek PR debug/52165 * var-tracking.c (emit_note_insn_var_location): If EMIT_NOTE_BEFORE_INSN and insn is NOTE_INSN_CALL_ARG_LOCATION, emit it before next non-NOTE_INSN_CALL_ARG_LOCATION non-NOTE_DURING_CALL_P insn. Jakub --- gcc/var-tracking.c.jj 2012-01-30 00:10:01.000000000 +0100 +++ gcc/var-tracking.c 2012-02-08 16:20:54.808523330 +0100 @@ -8225,9 +8225,14 @@ emit_note_insn_var_location (void **varp /* Make sure that the call related notes come first. */ while (NEXT_INSN (insn) && NOTE_P (insn) - && NOTE_DURING_CALL_P (insn)) + && ((NOTE_KIND (insn) == NOTE_INSN_VAR_LOCATION + && NOTE_DURING_CALL_P (insn)) + || NOTE_KIND (insn) == NOTE_INSN_CALL_ARG_LOCATION)) insn = NEXT_INSN (insn); - if (NOTE_P (insn) && NOTE_DURING_CALL_P (insn)) + if (NOTE_P (insn) + && ((NOTE_KIND (insn) == NOTE_INSN_VAR_LOCATION + && NOTE_DURING_CALL_P (insn)) + || NOTE_KIND (insn) == NOTE_INSN_CALL_ARG_LOCATION)) note = emit_note_after (NOTE_INSN_VAR_LOCATION, insn); else note = emit_note_before (NOTE_INSN_VAR_LOCATION, insn);