+2014-09-25 Jiong Wang <jiong.wang@arm.com>
+
+ * shrink-wrap.c (move_insn_for_shrink_wrap): Initialize the live-in of
+ new created BB as the intersection of live-in from "old_dest" and
+ live-out from "bb".
+
2014-09-25 Felix Yang <felix.yang@huawei.com>
* lra.c (lra_set_insn_recog_data): Fix typo in comment.
if (!df_live)
return false;
+ basic_block old_dest = live_edge->dest;
next_block = split_edge (live_edge);
/* We create a new basic block. Call df_grow_bb_info to make sure
all data structures are allocated. */
df_grow_bb_info (df_live);
- bitmap_copy (df_get_live_in (next_block), df_get_live_out (bb));
+
+ bitmap_and (df_get_live_in (next_block), df_get_live_out (bb),
+ df_get_live_in (old_dest));
df_set_bb_dirty (next_block);
/* We should not split more than once for a function. */
- gcc_assert (!(*split_p));
+ if (*split_p)
+ return false;
+
*split_p = true;
}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-pro_and_epilogue" } */
+
+enum machine_mode
+{
+ FAKE_0,
+ FAKE_1,
+ FAKE_2,
+ FAKE_3,
+ FAKE_4,
+ FAKE_5,
+ NUM_MACHINE_MODES,
+};
+
+typedef int *rtx;
+typedef long unsigned int size_t;
+extern unsigned char mode_size[NUM_MACHINE_MODES];
+
+extern rtx c_readstr (const char *, enum machine_mode);
+extern rtx convert_to_mode (enum machine_mode, rtx, int);
+extern rtx expand_mult (enum machine_mode, rtx, rtx, rtx, int);
+extern rtx force_reg (enum machine_mode, rtx);
+extern void *memset (void *__s, int __c, size_t __n);
+
+rtx
+builtin_memset_gen_str (void *data, long offset __attribute__ ((__unused__)),
+ enum machine_mode mode)
+{
+ rtx target, coeff;
+ size_t size;
+ char *p;
+
+ size = ((unsigned short) (__builtin_constant_p (mode)
+ ? mode_size_inline (mode) : mode_size[mode]));
+ if (size == 1)
+ return (rtx) data;
+
+ p = ((char *) __builtin_alloca(sizeof (char) * (size)));
+ memset (p, 1, size);
+ coeff = c_readstr (p, mode);
+
+ target = convert_to_mode (mode, (rtx) data, 1);
+ target = expand_mult (mode, target, coeff, (rtx) 0, 1);
+ return force_reg (mode, target);
+}
+
+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
+/* { dg-final { cleanup-rtl-dump "pro_and_epilogue" } } */