PR rtl-optimization/29128
* sched-int.h (IS_SPECULATION_BRANCHY_CHECK_P): New macro.
* sched-ebb.c (advance_target_bb): Use it to fix condition to
allow interblock movement of speculation checks.
* gcc.c-torture/compile/pr29128.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117515
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-10-06 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
+
+ PR rtl-optimization/29128
+ * sched-int.h (IS_SPECULATION_BRANCHY_CHECK_P): New macro.
+ * sched-ebb.c (advance_target_bb): Use it to fix condition to
+ allow interblock movement of speculation checks.
+
2006-10-06 Zdenek Dvorak <dvorakz@suse.cz>
PR middle-end/29256
{
if (BLOCK_FOR_INSN (insn) != bb
&& control_flow_insn_p (insn)
- && !RECOVERY_BLOCK (insn)
- && !RECOVERY_BLOCK (BB_END (bb)))
+ /* We handle interblock movement of the speculation check
+ or over a speculation check in
+ haifa-sched.c: move_block_after_check (). */
+ && !IS_SPECULATION_BRANCHY_CHECK_P (insn)
+ && !IS_SPECULATION_BRANCHY_CHECK_P (BB_END (bb)))
{
+ /* Assert that we don't move jumps across blocks. */
gcc_assert (!control_flow_insn_p (BB_END (bb))
&& NOTE_INSN_BASIC_BLOCK_P (BB_HEAD (bb->next_bb)));
return bb;
#define RECOVERY_BLOCK(INSN) (h_i_d[INSN_UID (INSN)].recovery_block)
#define ORIG_PAT(INSN) (h_i_d[INSN_UID (INSN)].orig_pat)
+/* INSN is a speculation check that will branch to RECOVERY_BLOCK if the
+ speculation fail. Insns in that block will reexecute the speculatively
+ scheduled code and then will return immediatelly after INSN thus preserving
+ semantics of the program. */
+#define IS_SPECULATION_BRANCHY_CHECK_P(INSN) \
+ (RECOVERY_BLOCK (INSN) != NULL && RECOVERY_BLOCK (INSN) != EXIT_BLOCK_PTR)
+
/* DEP_STATUS of the link encapsulates information, that is needed for
speculative scheduling. Namely, it is 4 integers in the range
[0, MAX_DEP_WEAK] and 3 bits.
+2006-10-06 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
+
+ PR rtl-optimization/29128
+ * gcc.c-torture/compile/pr29128.c: New test.
+
2006-10-06 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.dg/actual_array_constructor_2.f90: Remove '\r's from
--- /dev/null
+typedef unsigned long Eterm;
+process_main (void)
+{
+ register Eterm x0;
+ register Eterm *reg = ((void *) 0);
+ register Eterm *I = ((void *) 0);
+ static void *opcodes[] = {
+ &&lb_allocate_heap_zero_III,
+ &&lb_allocate_init_tIy, &&lb_allocate_zero_tt
+ };
+lb_allocate_heap_III:{
+ Eterm *next;
+ goto *(next);
+ }
+lb_allocate_heap_zero_III:{
+ }
+lb_allocate_init_tIy:{
+ }
+lb_allocate_zero_tt:{
+ Eterm *next;
+ {
+ Eterm *tmp_ptr = ((Eterm *) (((x0)) - 0x1));
+ (*(Eterm *) (((unsigned char *) reg) + (I[(0) + 1]))) = ((tmp_ptr)[0]);
+ x0 = ((tmp_ptr)[1]);
+ }
+ goto *(next);
+ }
+}