--- /dev/null
+/* { dg-add-options vect_early_break } */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_early_break } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-additional-options "-w" } */
+
+namespace a {
+class b {
+public:
+ b d(long);
+};
+class e : public b {};
+typedef short f;
+typedef struct g *h;
+typedef struct g {
+ f c;
+ e *fp;
+ f j, *k, *l;
+} m;
+static h n(m *, unsigned, unsigned *);
+f o(m *, unsigned);
+void p(short *t) {
+ m *ffile;
+ int q;
+ unsigned r;
+ int i;
+ q = t[i];
+ n(ffile, q, &r);
+}
+h n(m *ffile, unsigned q, unsigned *) {
+ h glyph;
+ for (; glyph;)
+ if (glyph->c)
+ o(ffile, q);
+ int i;
+s:
+ for (i = 0; ffile->j; i++)
+ if (ffile->k[i]) {
+ if (q)
+ ffile->fp->d(ffile->l[i]);
+ break;
+ }
+ if (q < 6) {
+ q += 61440;
+ goto s;
+ }
+}
+} // namespace a
+
+/* { dg-final { scan-tree-dump {note:\s*Alignment of access forced using peeling.} "vect" } } */
+/* { dg-final { scan-tree-dump {vectorized 1 loops in function} "vect" } } */
--- /dev/null
+/* { dg-add-options vect_early_break } */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_early_break } */
+/* { dg-require-effective-target vect_int } */
+
+char b;
+int c(char *d) {
+ int *a = 0;
+ while (*d) {
+ while (*a)
+ if (*a++ == 1)
+ return 1;
+ d++;
+ }
+}
+void e() {
+ c(&b);
+ char *f = &b;
+ while (f[0])
+ ++b;
+}
+
+/* { dg-final { scan-tree-dump {note:\s*Alignment of access forced using peeling.} "vect" } } */
+/* { dg-final { scan-tree-dump {if \(ivtmp_[0-9_]+ >= prolog_loop_niters.[0-9_]+\)\n\s*goto} "vect" } } */
+/* { dg-final { scan-tree-dump {vectorized 1 loops in function} "vect" } } */
--- /dev/null
+/* { dg-add-options vect_early_break } */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_early_break } */
+/* { dg-require-effective-target vect_int } */
+
+struct {
+ int segments[];
+} seek_to_sample_coarse_f;
+
+int seek_to_sample_coarse_i, seek_to_sample_coarse_f_1;
+
+void seek_to_sample_coarse() {
+ int end_pos = seek_to_sample_coarse_f_1;
+ for (;;) {
+ seek_to_sample_coarse_i = end_pos;
+ for (; end_pos > 0; --end_pos)
+ if (seek_to_sample_coarse_f.segments[end_pos - 1])
+ break;
+ if (end_pos)
+ break;
+ }
+}
+
+/* { dg-final { scan-tree-dump {note:\s*Alignment of access forced using peeling.} "vect" } } */
+/* { dg-final { scan-tree-dump {if \(ivtmp_[0-9_]+ >= prolog_loop_niters.[0-9_]+\)\n\s*goto} "vect" } } */
+/* { dg-final { scan-tree-dump {vectorized 1 loops in function} "vect" } } */
flush_pending_stmts (new_exit);
set_immediate_dominator (CDI_DOMINATORS, preheader, new_exit->src);
- if (create_main_e)
- set_immediate_dominator (CDI_DOMINATORS, scalar_exit->dest,
- recompute_dominator (CDI_DOMINATORS,
- scalar_exit->dest));
-
/* And remove the non-necessary forwarder again. Keep the other
one so we have a proper pre-header for the loop at the exit edge. */
redirect_edge_pred (single_succ_edge (new_preheader),
}
}
}
+
+ /* When loop_exit != scalar_exit due to if-conversion loop versioning,
+ the `scalar_exit' now has two incoming edges, one from the if-converted
+ and one from the peeled prolog loop. It is therefore dominated by a
+ common block between these. Update its dominator accordingly. */
+ if (create_main_e && loop_exit != scalar_exit)
+ set_immediate_dominator (CDI_DOMINATORS, scalar_exit->dest,
+ recompute_dominator (CDI_DOMINATORS,
+ scalar_exit->dest));
}
free (new_bbs);