From 2d68d2ef5ff898a3d34b28d57974c1c524ea3654 Mon Sep 17 00:00:00 2001 From: hubicka Date: Wed, 14 Nov 2012 23:14:05 +0000 Subject: [PATCH] * builtins.c (define_builtin): Accept ECF flags and use set_call_expr_flags. (initialize_builtins): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193513 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/ChangeLog | 6 ++++++ gcc/java/builtins.c | 47 +++++++++++++++++++++-------------------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 190d48c..0f27224 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,9 @@ +2012-11-15 Jan Hubicka + + * builtins.c (define_builtin): Accept ECF flags and + use set_call_expr_flags. + (initialize_builtins): Update. + 2012-10-01 Lawrence Crowl * Make-lang.in (JAVA_OBJS): Add dependence on hash-table.o. diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index 66addcb..b873a8f 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -451,8 +451,6 @@ VMSupportsCS8_builtin (tree method_return_type, -#define BUILTIN_NOTHROW 1 -#define BUILTIN_CONST 2 /* Define a single builtin. */ static void define_builtin (enum built_in_function val, @@ -471,10 +469,7 @@ define_builtin (enum built_in_function val, pushdecl (decl); DECL_BUILT_IN_CLASS (decl) = BUILT_IN_NORMAL; DECL_FUNCTION_CODE (decl) = val; - if (flags & BUILTIN_NOTHROW) - TREE_NOTHROW (decl) = 1; - if (flags & BUILTIN_CONST) - TREE_READONLY (decl) = 1; + set_call_expr_flags (decl, flags); set_builtin_decl (val, decl, true); } @@ -512,49 +507,49 @@ initialize_builtins (void) double_type_node, double_type_node, NULL_TREE); define_builtin (BUILT_IN_FMOD, "__builtin_fmod", - double_ftype_double_double, "fmod", BUILTIN_CONST); + double_ftype_double_double, "fmod", ECF_CONST); define_builtin (BUILT_IN_FMODF, "__builtin_fmodf", - float_ftype_float_float, "fmodf", BUILTIN_CONST); + float_ftype_float_float, "fmodf", ECF_CONST); define_builtin (BUILT_IN_ACOS, "__builtin_acos", double_ftype_double, "_ZN4java4lang4Math4acosEJdd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_ASIN, "__builtin_asin", double_ftype_double, "_ZN4java4lang4Math4asinEJdd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_ATAN, "__builtin_atan", double_ftype_double, "_ZN4java4lang4Math4atanEJdd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_ATAN2, "__builtin_atan2", double_ftype_double_double, "_ZN4java4lang4Math5atan2EJddd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_CEIL, "__builtin_ceil", double_ftype_double, "_ZN4java4lang4Math4ceilEJdd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_COS, "__builtin_cos", double_ftype_double, "_ZN4java4lang4Math3cosEJdd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_EXP, "__builtin_exp", double_ftype_double, "_ZN4java4lang4Math3expEJdd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_FLOOR, "__builtin_floor", double_ftype_double, "_ZN4java4lang4Math5floorEJdd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_LOG, "__builtin_log", double_ftype_double, "_ZN4java4lang4Math3logEJdd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_POW, "__builtin_pow", double_ftype_double_double, "_ZN4java4lang4Math3powEJddd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_SIN, "__builtin_sin", double_ftype_double, "_ZN4java4lang4Math3sinEJdd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_SQRT, "__builtin_sqrt", double_ftype_double, "_ZN4java4lang4Math4sqrtEJdd", - BUILTIN_CONST); + ECF_CONST); define_builtin (BUILT_IN_TAN, "__builtin_tan", double_ftype_double, "_ZN4java4lang4Math3tanEJdd", - BUILTIN_CONST); + ECF_CONST); boolean_ftype_boolean_boolean = build_function_type_list (boolean_type_node, @@ -563,28 +558,28 @@ initialize_builtins (void) define_builtin (BUILT_IN_EXPECT, "__builtin_expect", boolean_ftype_boolean_boolean, "__builtin_expect", - BUILTIN_CONST | BUILTIN_NOTHROW); + ECF_CONST | ECF_NOTHROW); define_builtin (BUILT_IN_SYNC_BOOL_COMPARE_AND_SWAP_4, "__sync_bool_compare_and_swap_4", build_function_type_list (boolean_type_node, int_type_node, build_pointer_type (int_type_node), int_type_node, NULL_TREE), - "__sync_bool_compare_and_swap_4", 0); + "__sync_bool_compare_and_swap_4", ECF_NOTHROW | ECF_LEAF); define_builtin (BUILT_IN_SYNC_BOOL_COMPARE_AND_SWAP_8, "__sync_bool_compare_and_swap_8", build_function_type_list (boolean_type_node, long_type_node, build_pointer_type (long_type_node), int_type_node, NULL_TREE), - "__sync_bool_compare_and_swap_8", 0); + "__sync_bool_compare_and_swap_8", ECF_NOTHROW | ECF_LEAF); define_builtin (BUILT_IN_SYNC_SYNCHRONIZE, "__sync_synchronize", build_function_type_list (void_type_node, NULL_TREE), - "__sync_synchronize", BUILTIN_NOTHROW); + "__sync_synchronize", ECF_NOTHROW | ECF_LEAF); define_builtin (BUILT_IN_RETURN_ADDRESS, "__builtin_return_address", build_function_type_list (ptr_type_node, int_type_node, NULL_TREE), - "__builtin_return_address", BUILTIN_NOTHROW); + "__builtin_return_address", ECF_NOTHROW | ECF_LEAF); build_common_builtin_nodes (); } -- 2.7.4