aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-05-02 15:46:12 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-05-02 15:46:12 +0000
commit9f8e7a96c2d45daf5ee6e0ce9a1cbe4c80cbf96b (patch)
treea30ed31ba45668a2b166c79de88b5a8d7423feb4 /gcc/tree-inline.c
parentf3a81b39c05f955e6203ec1a61b517563d63314f (diff)
downloadgcc-9f8e7a96c2d45daf5ee6e0ce9a1cbe4c80cbf96b.zip
gcc-9f8e7a96c2d45daf5ee6e0ce9a1cbe4c80cbf96b.tar.gz
gcc-9f8e7a96c2d45daf5ee6e0ce9a1cbe4c80cbf96b.tar.bz2
re PR middle-end/57140 (Segmentation fault in backtrace_dwarf_add)
2013-05-02 Richard Biener <rguenther@suse.de> PR middle-end/57140 * tree-inline.c (copy_loops): Properly handle removed loops. (copy_cfg_body): Mark destination loops for fixup if source loops needed fixup. * g++.dg/torture/pr57140.C: New testcase. From-SVN: r198548
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index a650f0d..b5339c4 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2208,8 +2208,11 @@ copy_loops (bitmap blocks_to_copy,
/* Assign the new loop its header and latch and associate
those with the new loop. */
- dest_loop->header = (basic_block)src_loop->header->aux;
- dest_loop->header->loop_father = dest_loop;
+ if (src_loop->header != NULL)
+ {
+ dest_loop->header = (basic_block)src_loop->header->aux;
+ dest_loop->header->loop_father = dest_loop;
+ }
if (src_loop->latch != NULL)
{
dest_loop->latch = (basic_block)src_loop->latch->aux;
@@ -2336,6 +2339,11 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale,
loops_state_set (LOOPS_NEED_FIXUP);
}
+ /* If the loop tree in the source function needed fixup, mark the
+ destination loop tree for fixup, too. */
+ if (loops_for_fn (src_cfun)->state & LOOPS_NEED_FIXUP)
+ loops_state_set (LOOPS_NEED_FIXUP);
+
if (gimple_in_ssa_p (cfun))
FOR_ALL_BB_FN (bb, cfun_to_copy)
if (!blocks_to_copy