From patchwork Mon Oct 6 09:55:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 396763 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 61EAC1400E0 for ; Mon, 6 Oct 2014 20:59:06 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=LUFd3B6lU1FVSygB pLX6/rE4gXy9D8W8rxh/JE+tmyC4souUGY5zRqSkSRX04lqByOvLBI5GZoLMr8nm vM1aGL9zkW8Vbbc/NJihfQ1XwRMWyWwuCEat0qYOZmDUnut3ZotpyxMDhvcVnZhC 8r+tpw0pdwFHIl1mo+iW0FQnqlo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=kruNwysso4KHd8tvmbKjw7 /9xic=; b=f429mtsZ1ro1w3ankXMDqZ+3jriXAABmY6rEZuIojjj9P/2bMWf/Wi U0WOr6NEMNm2h+6DWY8BU5fa8PRywPZXd3F5v1zVfwiaHweYP9FP1HecXrFS56eO /Q1ED1qA+RuQ9gCCGwEy5pHDK0k1bMv04d/axccjTB5hwxSH8eI7w= Received: (qmail 19000 invoked by alias); 6 Oct 2014 09:59:00 -0000 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 Received: (qmail 18990 invoked by uid 89); 6 Oct 2014 09:58:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 06 Oct 2014 09:58:57 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id B8484274FC74 for ; Mon, 6 Oct 2014 11:58:54 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mb7JOmtrf8af for ; Mon, 6 Oct 2014 11:58:54 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 95A29274FA95 for ; Mon, 6 Oct 2014 11:58:54 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix trace numbering in .dwarf2 dump file Date: Mon, 06 Oct 2014 11:55:56 +0200 Message-ID: <8412842.hbkO4nvdhb@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; ) MIME-Version: 1.0 The numbering of traces in the .dwarf2 dump file is broken, for example: Creating trace 0 : start at note 1 Creating trace 1 : start at note 51 Creating trace 2 : start at code_label 16 Creating trace 3 : start at code_label 23 Creating trace 4 : start at code_label 38 Creating trace 5 : start at code_label 29 Processing trace 0 : start at note 1 saw edge from trace 0 to 0 (via fallthru 0) push trace 0 to worklist Processing trace 0 : start at note 51 saw edge from trace 0 to 1 (via jump_insn 11) push trace 1 to worklist saw edge from trace 0 to 2 (via jump_insn 13) push trace 2 to worklist Processing trace 2 : start at code_label 23 saw edge from trace 2 to 4 (via jump_insn 26) push trace 4 to worklist saw edge from trace 2 to 3 (via fallthru 0) push trace 3 to worklist Processing trace 3 : start at code_label 38 saw edge from trace 3 to 3 (via jump_insn 61) Processing trace 4 : start at code_label 29 Processing trace 1 : start at code_label 16 saw edge from trace 1 to 1 (via jump_insn 19) Note the 2 "Processing trace 0" and the off-by-one discrepancy between the "Creating" and the "Processing" lines. Tested on x86_64-suse-linux, applied on the mainline as obvious. 2014-10-06 Eric Botcazou * dwarf2cfi.c (create_pseudo_cfg): Fix trace numbering. Index: dwarf2cfi.c =================================================================== --- dwarf2cfi.c (revision 215843) +++ dwarf2cfi.c (working copy) @@ -2763,7 +2763,7 @@ create_pseudo_cfg (void) memset (&ti, 0, sizeof (ti)); ti.head = insn; ti.switch_sections = switch_sections; - ti.id = trace_info.length () - 1; + ti.id = trace_info.length (); trace_info.safe_push (ti); saw_barrier = false; @@ -2781,7 +2781,7 @@ create_pseudo_cfg (void) dw_trace_info **slot; if (dump_file) - fprintf (dump_file, "Creating trace %u : start at %s %d%s\n", i, + fprintf (dump_file, "Creating trace %u : start at %s %d%s\n", tp->id, rtx_name[(int) GET_CODE (tp->head)], INSN_UID (tp->head), tp->switch_sections ? " (section switch)" : "");