From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12655 invoked by alias); 23 Nov 2013 04:30:20 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12397 invoked by uid 55); 23 Nov 2013 04:30:15 -0000 From: "tejohnson at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/57451] Incorrect debug ranges emitted for -freorder-blocks-and-partition -g Date: Sat, 23 Nov 2013 04:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tejohnson at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg02370.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57451 --- Comment #10 from tejohnson at gcc dot gnu.org --- Author: tejohnson Date: Sat Nov 23 04:30:07 2013 New Revision: 205298 URL: http://gcc.gnu.org/viewcvs?rev=205298&root=gcc&view=rev Log: Backport to google/4_8 new sanity checking and some dwarf emission fixes for -freorder-blocks-and-partition from trunk (r201883, r201941, r202125). ------------------------------------------------------------------------ r201883 | tejohnson | 2013-08-20 06:29:53 -0700 (Tue, 20 Aug 2013) | 8 lines Changed paths: M /trunk/gcc/ChangeLog M /trunk/gcc/final.c M /trunk/gcc/testsuite/ChangeLog A /trunk/gcc/testsuite/g++.dg/tree-prof/pr57451.C 2013-08-20 Teresa Johnson PR rtl-optimizations/57451 * final.c (reemit_insn_block_notes): Prevent lexical blocks from crossing split section boundaries. * testsuite/g++.dg/tree-prof/pr57451.C: New test. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r201941 | tejohnson | 2013-08-23 07:31:06 -0700 (Fri, 23 Aug 2013) | 7 lines Changed paths: M /trunk/gcc/ChangeLog M /trunk/gcc/final.c 2013-08-23 Kaz Kojima PR rtl-optimization/58220 PR regression/58221 * final.c (reemit_insn_block_notes): Use NEXT_INSN to handle SEQUENCE insns properly. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r202125 | tejohnson | 2013-08-30 18:43:33 -0700 (Fri, 30 Aug 2013) | 30 lines Changed paths: M /trunk/gcc/ChangeLog M /trunk/gcc/basic-block.h M /trunk/gcc/bb-reorder.c M /trunk/gcc/cfg.c M /trunk/gcc/cfgcleanup.c M /trunk/gcc/cfgrtl.c M /trunk/gcc/predict.c This patch sanitizes the partitioning to address issues such as edge weight insanities that sometimes occur due to upstream optimizations, and ensures that hot blocks are not dominated by cold blocks. This needs to be resanitized after certain cfg optimizations that may cause hot blocks previously reached via both hot and cold paths to only be reached by cold paths. The verification code in sanitize_dominator_hotness was contributed by Steven Bosscher. 2013-08-29 Teresa Johnson Steven Bosscher * cfgrtl.c (fixup_new_cold_bb): New routine. (commit_edge_insertions): Invoke fixup_partitions. (find_partition_fixes): New routine. (fixup_partitions): Ditto. (verify_hot_cold_block_grouping): Update comments. (rtl_verify_edges): Invoke find_partition_fixes. (rtl_verify_bb_pointers): Update comments. (rtl_verify_bb_layout): Ditto. * basic-block.h (probably_never_executed_edge_p): Declare. (fixup_partitions): Ditto. * cfgcleanup.c (try_optimize_cfg): Invoke fixup_partitions. * bb-reorder.c (sanitize_hot_paths): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): Invoke sanitize_hot_paths. * predict.c (probably_never_executed_edge_p): New routine. * cfg.c (check_bb_profile): Add partition insanity warnings. ------------------------------------------------------------------------ Added: branches/google/gcc-4_8/gcc/testsuite/g++.dg/tree-prof/pr57451.C Modified: branches/google/gcc-4_8/gcc/basic-block.h branches/google/gcc-4_8/gcc/bb-reorder.c branches/google/gcc-4_8/gcc/cfg.c branches/google/gcc-4_8/gcc/cfgcleanup.c branches/google/gcc-4_8/gcc/cfgrtl.c branches/google/gcc-4_8/gcc/final.c branches/google/gcc-4_8/gcc/predict.c