aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-loop-distribution.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-05-11 14:53:43 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-05-11 14:53:43 +0200
commitb03c30822bba445ae68699bd7e9efa8f8e07070a (patch)
treee56042c0e2d22f04c029f1f376845c9c63d30b83 /gcc/tree-loop-distribution.c
parentb5e04de5e321eef54e6d85d155981fdbbdd09428 (diff)
downloadgcc-b03c30822bba445ae68699bd7e9efa8f8e07070a.zip
gcc-b03c30822bba445ae68699bd7e9efa8f8e07070a.tar.gz
gcc-b03c30822bba445ae68699bd7e9efa8f8e07070a.tar.bz2
re PR debug/48159 (ICE: SIGSEGV in build2_stat (tree.c:3802) with -ftree-loop-distribution -g)
PR debug/48159 * tree-ssa.c (reset_debug_uses): New function. * tree-flow.h (reset_debug_uses): New prototype. * tree-data-ref.c (stmts_from_loop): Ignore debug stmts. * tree-loop-distribution.c (generate_loops_for_partition): Call reset_debug_uses on the stmts that will be removed. Keep around all debug stmts, don't count them as bits in partition bitmap. (generate_builtin): Don't count debug stmts or labels as bits in partition bitmap. * gcc.dg/pr48159-1.c: New test. * gcc.dg/pr48159-2.c: New test. From-SVN: r173656
Diffstat (limited to 'gcc/tree-loop-distribution.c')
-rw-r--r--gcc/tree-loop-distribution.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 5b147e3..1d6944e 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -1,5 +1,5 @@
/* Loop distribution.
- Copyright (C) 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Georges-Andre Silber <Georges-Andre.Silber@ensmp.fr>
and Sebastian Pop <sebastian.pop@amd.com>.
@@ -181,6 +181,25 @@ generate_loops_for_partition (struct loop *loop, bitmap partition, bool copy_p)
stmts_from_loop. */
bbs = get_loop_body_in_dom_order (loop);
+ if (MAY_HAVE_DEBUG_STMTS)
+ for (x = 0, i = 0; i < loop->num_nodes; i++)
+ {
+ basic_block bb = bbs[i];
+
+ for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ if (!bitmap_bit_p (partition, x++))
+ reset_debug_uses (gsi_stmt (bsi));
+
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ {
+ gimple stmt = gsi_stmt (bsi);
+ if (gimple_code (stmt) != GIMPLE_LABEL
+ && !is_gimple_debug (stmt)
+ && !bitmap_bit_p (partition, x++))
+ reset_debug_uses (stmt);
+ }
+ }
+
for (x = 0, i = 0; i < loop->num_nodes; i++)
{
basic_block bb = bbs[i];
@@ -199,7 +218,8 @@ generate_loops_for_partition (struct loop *loop, bitmap partition, bool copy_p)
for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi);)
{
gimple stmt = gsi_stmt (bsi);
- if (gimple_code (gsi_stmt (bsi)) != GIMPLE_LABEL
+ if (gimple_code (stmt) != GIMPLE_LABEL
+ && !is_gimple_debug (stmt)
&& !bitmap_bit_p (partition, x++))
{
unlink_stmt_vdef (stmt);
@@ -312,7 +332,9 @@ generate_builtin (struct loop *loop, bitmap partition, bool copy_p)
{
gimple stmt = gsi_stmt (bsi);
- if (bitmap_bit_p (partition, x++)
+ if (gimple_code (stmt) != GIMPLE_LABEL
+ && !is_gimple_debug (stmt)
+ && bitmap_bit_p (partition, x++)
&& is_gimple_assign (stmt)
&& !is_gimple_reg (gimple_assign_lhs (stmt)))
{