Commit f5b77e7d by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/46885 (ICE: in gsi_insert_seq_nodes_after, at…

re PR middle-end/46885 (ICE: in gsi_insert_seq_nodes_after, at gimple-iterator.c:251 with -ftree-parallelize-loops -g)

	PR debug/46885
	* tree-ssa-loop-manip.c (canonicalize_loop_ivs): Use gsi_last_bb
	instead of gsi_last_nondebug_bb if bump_in_latch.

	* gcc.dg/autopar/pr46885.c: New test.

From-SVN: r167801
parent 8236c8eb
2010-12-14 Jakub Jelinek <jakub@redhat.com> 2010-12-14 Jakub Jelinek <jakub@redhat.com>
PR debug/46885
* tree-ssa-loop-manip.c (canonicalize_loop_ivs): Use gsi_last_bb
instead of gsi_last_nondebug_bb if bump_in_latch.
PR tree-optimization/46909 PR tree-optimization/46909
* gimple-fold.c (and_var_with_comparison_1): Save partial * gimple-fold.c (and_var_with_comparison_1): Save partial
result even in the is_and case, if both partial results result even in the is_and case, if both partial results
2010-12-14 Jakub Jelinek <jakub@redhat.com> 2010-12-14 Jakub Jelinek <jakub@redhat.com>
PR debug/46885
* gcc.dg/autopar/pr46885.c: New test.
PR tree-optimization/46909 PR tree-optimization/46909
* gcc.c-torture/execute/pr46909-1.c: New test. * gcc.c-torture/execute/pr46909-1.c: New test.
* gcc.c-torture/execute/pr46909-2.c: New test. * gcc.c-torture/execute/pr46909-2.c: New test.
......
/* PR debug/46885 */
/* { dg-do compile } */
/* { dg-options "-O -ftree-parallelize-loops=4 -fcompare-debug -fno-tree-dominator-opts -funswitch-loops" } */
static inline void
bar (int i)
{
(void) i;
}
int
foo (int *begin, int *end)
{
int s = 0;
int *i;
for (i = begin; i != end; ++i)
{
bar (0);
if (begin)
return s;
}
return 0;
}
...@@ -1221,7 +1221,10 @@ canonicalize_loop_ivs (struct loop *loop, tree *nit, bool bump_in_latch) ...@@ -1221,7 +1221,10 @@ canonicalize_loop_ivs (struct loop *loop, tree *nit, bool bump_in_latch)
gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts); gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
} }
gsi = gsi_last_nondebug_bb (bump_in_latch ? loop->latch : loop->header); if (bump_in_latch)
gsi = gsi_last_bb (loop->latch);
else
gsi = gsi_last_nondebug_bb (loop->header);
create_iv (build_int_cst_type (type, 0), build_int_cst (type, 1), NULL_TREE, create_iv (build_int_cst_type (type, 0), build_int_cst (type, 1), NULL_TREE,
loop, &gsi, bump_in_latch, &var_before, NULL); loop, &gsi, bump_in_latch, &var_before, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment