--- /dev/null
+/* { dg-do compile } */
+
+__attribute__((returns_twice)) int foo();
+
+struct xio myproc;
+struct xio {
+ void (*read_proc)();
+ void (*write_proc)();
+};
+
+void dummy_write_proc() {
+ switch (foo())
+ default:
+ myproc.read_proc = myproc.write_proc = dummy_write_proc;
+}
{
r |= vect_slp_bbs (bbs, NULL);
bbs.truncate (0);
- bbs.quick_push (bb);
}
- else
- bbs.safe_push (bb);
+
+ /* We need to be able to insert at the head of the region which
+ we cannot for region starting with a returns-twice call. */
+ if (bbs.is_empty ())
+ if (gcall *first = safe_dyn_cast <gcall *> (first_stmt (bb)))
+ if (gimple_call_flags (first) & ECF_RETURNS_TWICE)
+ {
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "skipping bb%d as start of region as it "
+ "starts with returns-twice call\n",
+ bb->index);
+ continue;
+ }
+
+ bbs.safe_push (bb);
/* When we have a stmt ending this block and defining a
value we have to insert on edges when inserting after it for