+2004-04-27 Ed Schonberg <schonberg@gnat.com>
+
+ * a-wtmoio.ads: Formal type must be a modular type, not a signed
+ integer type.
+
+2004-04-27 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * decl.c (gnat_to_gnu_entity, case object): Call
+ __builtin_update_setjmp_buf.
+
+ * gigi.h (update_setjmp_buf): Deleted.
+ (ADT_update_setjmp_buf_decl, update_setjmp_buf_decl): New.
+
+ * misc.c: (update_setjmp_buf): Deleted.
+
+ * trans.c (gnat_to_gnu): Call do_pending_stack_adjust and emit_queue
+ around block of RTL.
+
+ * utils.c (init_gigi_decls): Initialize update_setjmp_buf.
+
2004-04-26 Thomas Quinot <quinot@act-europe.fr>
* sem_dist.adb, exp_dist.adb: When constructing a RAS value for a local
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- difference in semantics so that it is invisible to the Ada programmer.
private generic
- type Num is range <>;
+ type Num is mod <>;
package Ada.Wide_Text_IO.Modular_IO is
|| (flag_stack_check && ! STACK_CHECK_BUILTIN
&& 0 < compare_tree_int (DECL_SIZE_UNIT (gnu_decl),
STACK_CHECK_MAX_VAR_SIZE))))
- update_setjmp_buf (TREE_VALUE (gnu_block_stack));
+ expand_expr_stmt
+ (build_call_1_expr (update_setjmp_buf_decl,
+ build_unary_op
+ (ADDR_EXPR, NULL_TREE,
+ TREE_VALUE (gnu_block_stack))));
/* If this is a public constant or we're not optimizing and we're not
making a VAR_DECL for it, make one just for export or debugger
/* Make a TRANSFORM_EXPR to later expand GNAT_NODE into code. */
extern tree make_transform_expr (Node_Id);
-/* Update the setjmp buffer BUF with the current stack pointer. We assume
- here that a __builtin_setjmp was done to BUF. */
-extern void update_setjmp_buf (tree);
-
/* GNU_TYPE is a type. Determine if it should be passed by reference by
default. */
extern int default_pass_by_ref (tree);
ADT_get_excptr_decl,
ADT_setjmp_decl,
ADT_longjmp_decl,
+ ADT_update_setjmp_buf_decl,
ADT_raise_nodefer_decl,
ADT_begin_handler_decl,
ADT_end_handler_decl,
#define get_excptr_decl gnat_std_decls[(int) ADT_get_excptr_decl]
#define setjmp_decl gnat_std_decls[(int) ADT_setjmp_decl]
#define longjmp_decl gnat_std_decls[(int) ADT_longjmp_decl]
+#define update_setjmp_buf_decl gnat_std_decls[(int) ADT_update_setjmp_buf_decl]
#define raise_nodefer_decl gnat_std_decls[(int) ADT_raise_nodefer_decl]
#define begin_handler_decl gnat_std_decls[(int) ADT_begin_handler_decl]
#define end_handler_decl gnat_std_decls[(int) ADT_end_handler_decl]
return gnu_result;
}
\f
-/* Update the setjmp buffer BUF with the current stack pointer. We assume
- here that a __builtin_setjmp was done to BUF. */
-
-void
-update_setjmp_buf (tree buf)
-{
- enum machine_mode sa_mode = Pmode;
- rtx stack_save;
-
-#ifdef HAVE_save_stack_nonlocal
- if (HAVE_save_stack_nonlocal)
- sa_mode = insn_data[(int) CODE_FOR_save_stack_nonlocal].operand[0].mode;
-#endif
-#ifdef STACK_SAVEAREA_MODE
- sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL);
-#endif
-
- stack_save
- = gen_rtx_MEM (sa_mode,
- memory_address
- (sa_mode,
- plus_constant (expand_expr
- (build_unary_op (ADDR_EXPR, NULL_TREE, buf),
- NULL_RTX, VOIDmode, 0),
- 2 * GET_MODE_SIZE (Pmode))));
-
-#ifdef HAVE_setjmp
- if (HAVE_setjmp)
- emit_insn (gen_setjmp ());
-#endif
-
- emit_stack_save (SAVE_NONLOCAL, &stack_save, NULL_RTX);
-}
-\f
/* These routines are used in conjunction with GCC exception handling. */
/* Map compile-time to run-time tree for GCC exception handling scheme. */
we do generates RTL and returns error_mark_node. */
if (!global_bindings_p ())
{
+ do_pending_stack_adjust ();
+ emit_queue ();
start_sequence ();
emit_note (NOTE_INSN_DELETED);
made_sequence = true;
gigi_abort (303);
}
+ do_pending_stack_adjust ();
+ emit_queue ();
gnu_root = make_expr_stmt_from_rtl (first_nondeleted_insn (get_insns ()),
gnat_node);
end_sequence ();
}
else if (made_sequence)
{
- rtx insns = first_nondeleted_insn (get_insns ());
+ rtx insns;
+ do_pending_stack_adjust ();
+ emit_queue ();
+ insns = first_nondeleted_insn (get_insns ());
end_sequence ();
if (insns)
DECL_BUILT_IN_CLASS (setjmp_decl) = BUILT_IN_NORMAL;
DECL_FUNCTION_CODE (setjmp_decl) = BUILT_IN_SETJMP;
+ /* update_setjmp_buf updates a setjmp buffer from the current stack pointer
+ address. */
+ update_setjmp_buf_decl
+ = create_subprog_decl
+ (get_identifier ("__builtin_update_setjmp_buf"), NULL_TREE,
+ build_function_type (void_type_node,
+ tree_cons (NULL_TREE, jmpbuf_ptr_type, endlink)),
+ NULL_TREE, 0, 1, 1, 0);
+
+ DECL_BUILT_IN_CLASS (update_setjmp_buf_decl) = BUILT_IN_NORMAL;
+ DECL_FUNCTION_CODE (update_setjmp_buf_decl) = BUILT_IN_UPDATE_SETJMP_BUF;
+
main_identifier_node = get_identifier ("main");
}
\f