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
* gimple-fold.c (and_var_with_comparison_1): Save partial
result even in the is_and case, if both partial results
2010-12-14 Jakub Jelinek <jakub@redhat.com>
+ PR debug/46885
+ * gcc.dg/autopar/pr46885.c: New test.
+
PR tree-optimization/46909
* gcc.c-torture/execute/pr46909-1.c: New test.
* gcc.c-torture/execute/pr46909-2.c: New test.
--- /dev/null
+/* 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;
+}
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,
loop, &gsi, bump_in_latch, &var_before, NULL);