From b666e5681569d47b0d75b7bc5fecdcd513da4b88 Mon Sep 17 00:00:00 2001 From: Geert Bosch Date: Thu, 31 Jul 2008 12:27:20 +0200 Subject: arit64.c: New file implementing __gnat_mulv64 signed integer multiplication with overflow... 2008-07-31 Geert Bosch * arit64.c: New file implementing __gnat_mulv64 signed integer multiplication with overflow checking * fe.h (Backend_Overflow_Checks_On_Target): Define for use by Gigi * gcc-interface/gigi.h: (standard_types): Add ADT_mulv64_decl (mulv64_decl): Define subprogram declaration for __gnat_mulv64 * gcc-interface/utils.c: (init_gigi_decls): Add initialization of mulv64_decl * gcc-interface/trans.c: (build_unary_op_trapv): New function (build_binary_op_trapv): New function (gnat_to_gnu): Use the above functions instead of build_{unary,binary}_op * gcc-interface/Makefile.in (LIBGNAT_SRCS): Add arit64.c (LIBGNAT_OBJS): Add arit64.o From-SVN: r138384 --- gcc/ada/gcc-interface/utils.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/ada/gcc-interface/utils.c') diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 8822938..61e36fe 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -542,6 +542,7 @@ void init_gigi_decls (tree long_long_float_type, tree exception_type) { tree endlink, decl; + tree int64_type = gnat_type_for_size (64, 0); unsigned int i; /* Set the types that GCC and Gigi use from the front end. We would like @@ -630,6 +631,13 @@ init_gigi_decls (tree long_long_float_type, tree exception_type) endlink)), NULL_TREE, false, true, true, NULL, Empty); + /* This is used for 64-bit multiplication with overflow checking. */ + mulv64_decl + = create_subprog_decl (get_identifier ("__gnat_mulv64"), NULL_TREE, + build_function_type_list (int64_type, int64_type, + int64_type, NULL_TREE), + NULL_TREE, false, true, true, NULL, Empty); + /* Make the types and functions used for exception processing. */ jmpbuf_type = build_array_type (gnat_type_for_mode (Pmode, 0), -- cgit v1.1