aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorGeert Bosch <bosch@adacore.com>2008-07-31 12:27:20 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-07-31 12:27:20 +0200
commitb666e5681569d47b0d75b7bc5fecdcd513da4b88 (patch)
tree1a6f7b4149003b503d7b9e36f8cf1dc1cd606d93 /gcc/ada/gcc-interface/utils.c
parentb2c6b35f24ba203e027caa8e5206810d3d6ae265 (diff)
downloadgcc-b666e5681569d47b0d75b7bc5fecdcd513da4b88.zip
gcc-b666e5681569d47b0d75b7bc5fecdcd513da4b88.tar.gz
gcc-b666e5681569d47b0d75b7bc5fecdcd513da4b88.tar.bz2
arit64.c: New file implementing __gnat_mulv64 signed integer multiplication with overflow...
2008-07-31 Geert Bosch <bosch@adacore.com> * 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
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c8
1 files changed, 8 insertions, 0 deletions
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),