@@ -1,3 +1,9 @@
+2011-03-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/48016
+ * function.c (expand_function_start): Properly store frame
+ pointer for non-local goto.
+
2011-03-12 H.J. Lu <hongjiu.lu@intel.com>
PR target/48084
@@ -4751,6 +4751,7 @@ expand_function_start (tree subr)
{
tree t_save;
rtx r_save;
+ rtx frame_pointer;
/* ??? We need to do this save early. Unfortunately here is
before the frame variable gets declared. Help out... */
@@ -4762,9 +4763,14 @@ expand_function_start (tree subr)
cfun->nonlocal_goto_save_area,
integer_zero_node, NULL_TREE, NULL_TREE);
r_save = expand_expr (t_save, NULL_RTX, VOIDmode, EXPAND_WRITE);
- r_save = convert_memory_address (Pmode, r_save);
- emit_move_insn (r_save, targetm.builtin_setjmp_frame_value ());
+ /* We are storing frame pointer in R_SAVE here. */
+ frame_pointer = targetm.builtin_setjmp_frame_value ();
+ if (GET_MODE (frame_pointer) != GET_MODE (r_save))
+ frame_pointer = convert_to_mode (GET_MODE (r_save),
+ frame_pointer, 1);
+
+ emit_move_insn (r_save, frame_pointer);
update_nonlocal_goto_save_area ();
}