===================================================================
@@ -5752,6 +5752,9 @@ thread_prologue_and_epilogue_insns (void
if (hard_reg_set_intersect_p (live_on_edge, prologue_clobbered))
entry_edge = orig_entry_edge;
+ if (dump_file && entry_edge != orig_entry_edge)
+ fprintf (dump_file, "Prologue moved down by shrink-wrapping.\n");
+
fail_shrinkwrap:
bitmap_clear (&bb_antic_flags);
bitmap_clear (&bb_on_list);
===================================================================
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fshrink-wrap -fdump-rtl-pro_and_epilogue" } */
+
+#include <string.h>
+
+int c;
+int x[2000];
+__attribute__((regparm(1))) int foo (int a, int b)
+ {
+ int t[200];
+ if (a == 0)
+ return 1;
+ if (c == 0)
+ return 2;
+ memcpy (t, x + b, sizeof t);
+ return t[a];
+ }
+
+/* { dg-final { scan-rtl-dump "Prologue moved down" "pro_and_epilogue" } } */
+/* { dg-final { cleanup-rtl-dump "pro_and_epilogue" } } */