From patchwork Mon Aug 12 04:35:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teresa Johnson X-Patchwork-Id: 266414 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 004312C0087 for ; Mon, 12 Aug 2013 14:36:09 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=BHwqeQKQIuAZQ/3DH5wfdVz2izRrkTtQAGoG18Gm0T+ hCinkWrG+At/eWRH/amLzEskxvFRSnbcXDLlBCvRi4tZyPUzUBwbmnANi4M25A0d /ZhcAPEpYujHxrbkhryLte7mSGbbsUQsZX2G0zsJ0le1WrujQTVvk5n51Hwp7UDI = 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 :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=NahnZsAXOmU1b2h3JwU+p8ftWoI=; b=D3Zv26WU99+TkFFjW MPPZOQ3LWvcsBos7t4/t0sQMFhgEI+F8q2wRO3/DcwP11Lj40XT2yMGJg6VrlfIv GDijnBV1PCiBolCxUY9KhGSB7HrewVIzzUYmVDJVUZnvWnQzarAZlRDHf+o2UVzC uZYop3N3F7yBNFQzAYEQrKnXGI= Received: (qmail 31299 invoked by alias); 12 Aug 2013 04:36:01 -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 31286 invoked by uid 89); 12 Aug 2013 04:36:01 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 Received: from mail-qc0-f170.google.com (HELO mail-qc0-f170.google.com) (209.85.216.170) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 12 Aug 2013 04:36:00 +0000 Received: by mail-qc0-f170.google.com with SMTP id d10so3189161qcz.15 for ; Sun, 11 Aug 2013 21:35:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=X3WBU9takoVnmGaw2KLrnPjZZnCUe1zgNdHfx1wTZ8Q=; b=lLWmGCUikv0BrOPr6IRDePdqVJRcL47YZEBSHvQNO6D1v/jgUB1V2w7v4zT03yG9XW pgXXDCiaisz3dQhHG1ZCXeZ3sk7GrmfOuACInjsC17I4YW9PCpIdTYmVXTedeXV0zdX3 Yv5/6NT1VDzgJCCf9yCK3lJ3YAssWVqpp5CNqV6V0fHArGaNY+4FFpkXCDnZ2sPZsvHN j8bHKVjpJNiIcZTY5bRGFnxnsyreo625mLJ8mzO1OAz7Mv3UNFuFHE1hGOSBModcrSuj 9gGR40WzkVLxrCfGNgZuX5l2Sbg6JYyJoxHhMjjb07JbfJovuFSzw/Pc7RaZ+Oth6ZkN /kqA== X-Gm-Message-State: ALoCoQntlCgYNI4yCJmIKEI8ODBPzn37nxiTzces3xVZf9/wsj88/U9Z13pE4auOzLtwMgrUpJrsP4LUsVeOQ3MxDUyCDnbGZmhjf6NvKSWbNlyNDnYGzuoANfvffUKZPfXhfQUJVMDhDEots3eO1l+K4w8DSjGCU3k+DHo07k/vRS/SyFvwtnKiKYsYqiqiJ3ERPAMacju6A2X5mzX7c2oQFV43ZyayBA== MIME-Version: 1.0 X-Received: by 10.229.125.193 with SMTP id z1mr5324447qcr.62.1376282158388; Sun, 11 Aug 2013 21:35:58 -0700 (PDT) Received: by 10.49.40.162 with HTTP; Sun, 11 Aug 2013 21:35:58 -0700 (PDT) Date: Sun, 11 Aug 2013 21:35:58 -0700 Message-ID: Subject: [PATCH] Fix PR57451 (Incorrect debug ranges emitted for -freorder-blocks-and-partition -g) From: Teresa Johnson To: "gcc-patches@gcc.gnu.org" Cc: Cary Coutant , Christophe Lyon This patch fixes PR rtl-optimizations/57451 by preventing scopes and therefore lexical blocks from crossing split section boundaries. This will prevent debug info generation from using DW_AT_low_pc/high_pc pairs across the section boundary. Bootstrapped and tested on x86_64-unknown-linux-gnu. With this patch, a profilebootstrap with -freorder-blocks-and-partition force-enabled also passes. Ok for trunk? Thanks, Teresa 2013-08-11 Teresa Johnson PR rtl-optimizations/57451 * final.c (reemit_insn_block_notes): Prevent lexical blocks from crossing split section boundaries. Index: final.c =================================================================== --- final.c (revision 201644) +++ final.c (working copy) @@ -1650,12 +1650,26 @@ reemit_insn_block_notes (void) rtx insn, note; insn = get_insns (); - if (!active_insn_p (insn)) - insn = next_active_insn (insn); - for (; insn; insn = next_active_insn (insn)) + for (; insn; insn = next_insn (insn)) { tree this_block; + /* Prevent lexical blocks from straddling section boundaries. */ + if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_SWITCH_TEXT_SECTIONS) + { + for (tree s = cur_block; s != DECL_INITIAL (cfun->decl); + s = BLOCK_SUPERCONTEXT (s)) + { + rtx note = emit_note_before (NOTE_INSN_BLOCK_END, insn); + NOTE_BLOCK (note) = s; + note = emit_note_after (NOTE_INSN_BLOCK_BEG, insn); + NOTE_BLOCK (note) = s; + } + } + + if (!active_insn_p (insn)) + continue; + /* Avoid putting scope notes between jump table and its label. */ if (JUMP_TABLE_DATA_P (insn)) continue;