This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Exception handling: reload insns
- To: Richard Henderson <rth at redhat dot com>
- Subject: Exception handling: reload insns
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- Date: Thu, 3 May 2001 19:47:53 +0100 (BST)
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200104251708.f3PH85418453@cuddles.cambridge.redhat.com><20010425151438.C10620@redhat.com><15080.9236.900418.621037@cuddles.cambridge.redhat.com><20010426090059.A1389@redhat.com><15081.46052.845526.10019@cuddles.cambridge.redhat.com><20010427121220.B2118@redhat.com>
Same as before, this time for reload.
Andrew.
2001-05-03 Andrew Haley <aph@cambridge.redhat.com>
* reload1.c (copy_eh_notes): New function.
(emit_input_reload_insns): Call it.
(emit_output_reload_insns): Call it.
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.263
diff -c -p -2 -r1.263 reload1.c
*** reload1.c 2001/04/03 15:05:24 1.263
--- reload1.c 2001/05/03 18:34:15
*************** static void move2add_note_store PARAMS
*** 455,458 ****
--- 455,459 ----
static void add_auto_inc_notes PARAMS ((rtx, rtx));
#endif
+ static void copy_eh_notes PARAMS ((rtx, rtx));
static HOST_WIDE_INT sext_for_mode PARAMS ((enum machine_mode,
HOST_WIDE_INT));
*************** emit_input_reload_insns (chain, rl, old,
*** 6573,6580 ****
}
/* End this sequence. */
*where = get_insns ();
end_sequence ();
!
/* Update reload_override_in so that delete_address_reloads_1
can see the actual register usage. */
--- 6574,6584 ----
}
+ if (flag_non_call_exceptions)
+ copy_eh_notes (insn, get_insns ());
+
/* End this sequence. */
*where = get_insns ();
end_sequence ();
!
/* Update reload_override_in so that delete_address_reloads_1
can see the actual register usage. */
*************** emit_output_reload_insns (chain, rl, j)
*** 6791,6794 ****
--- 6795,6801 ----
output_reload_insns[rl->opnum] = get_insns ();
+ if (flag_non_call_exceptions)
+ copy_eh_notes (insn, get_insns ());
+
end_sequence ();
}
*************** add_auto_inc_notes (insn, x)
*** 9439,9440 ****
--- 9446,9467 ----
}
#endif
+
+ /* Copy EH notes from an insn to its reloads. */
+ static void
+ copy_eh_notes (insn, x)
+ rtx insn;
+ rtx x;
+ {
+ rtx eh_note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
+ if (eh_note)
+ {
+ for (; x != 0; x = NEXT_INSN (x))
+ {
+ if (may_trap_p (PATTERN (x)))
+ REG_NOTES (x)
+ = gen_rtx_EXPR_LIST (REG_EH_REGION, XEXP (eh_note, 0),
+ REG_NOTES (x));
+ }
+ }
+ }
+