From 321856ae54afc12d5aef1a56c195e51dfdd160e5 Mon Sep 17 00:00:00 2001 From: aph Date: Wed, 12 Aug 2009 16:10:12 +0000 Subject: 2009-08-12 Andrew Haley * builtins.c (compareAndSwapInt_builtin): Use flag_use_atomic_builtins. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. * jvspec.c: Add flag_use_atomic_builtins. * gcj.texi: Likewise. * java-tree.h: Likewise. * lang.opt: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150699 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/builtins.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gcc/java/builtins.c') diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index 0f7b197f78c..6e4815beeab 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -318,7 +318,8 @@ compareAndSwapInt_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree orig_call) { enum machine_mode mode = TYPE_MODE (int_type_node); - if (sync_compare_and_swap[mode] != CODE_FOR_nothing) + if (sync_compare_and_swap[mode] != CODE_FOR_nothing + || flag_use_atomic_builtins) { tree addr, stmt; UNMARSHAL5 (orig_call); @@ -337,7 +338,12 @@ compareAndSwapLong_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree orig_call) { enum machine_mode mode = TYPE_MODE (long_type_node); - if (sync_compare_and_swap[mode] != CODE_FOR_nothing) + if (sync_compare_and_swap[mode] != CODE_FOR_nothing + || (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (word_mode) + && flag_use_atomic_builtins)) + /* We don't trust flag_use_atomic_builtins for multi-word + compareAndSwap. Some machines such as ARM have atomic libfuncs + but not the multi-word versions. */ { tree addr, stmt; UNMARSHAL5 (orig_call); @@ -355,7 +361,8 @@ compareAndSwapObject_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree orig_call) { enum machine_mode mode = TYPE_MODE (ptr_type_node); - if (sync_compare_and_swap[mode] != CODE_FOR_nothing) + if (sync_compare_and_swap[mode] != CODE_FOR_nothing + || flag_use_atomic_builtins) { tree addr, stmt; int builtin; -- cgit v1.2.1 From e38def9ca7953bb5611d08ce8617249516ba5a99 Mon Sep 17 00:00:00 2001 From: rth Date: Mon, 14 Sep 2009 19:18:58 +0000 Subject: Squash commit of EH in gimple git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151696 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/builtins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/java/builtins.c') diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index 6e4815beeab..a05ff53ceb9 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -584,7 +584,7 @@ initialize_builtins (void) build_function_type_list (ptr_type_node, int_type_node, NULL_TREE), "__builtin_return_address", BUILTIN_NOTHROW); - build_common_builtin_nodes (); + build_common_builtin_nodes (true); } /* If the call matches a builtin, return the -- cgit v1.2.1 From 471eff3649c0d9383213b2dfef646d0496d43e28 Mon Sep 17 00:00:00 2001 From: rth Date: Mon, 28 Sep 2009 16:44:32 +0000 Subject: * except.h (struct eh_region_d): Add use_cxa_end_cleanup. * except.c (gen_eh_region): Set it. (duplicate_eh_regions_1): Copy it. * tree-eh.c (lower_resx): Use it to determine which function to call to resume. * langhooks.h (struct lang_hooks): Add eh_use_cxa_end_cleanup. * langhooks-def.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New. * builtins.def (BUILT_IN_CXA_END_CLEANUP): New. * tree.c (build_common_builtin_nodes): Remove parameter. Build BUILT_IN_CXA_END_CLEANUP if necessary. * tree.h (build_common_builtin_nodes): Update decl. * c-common.c (c_define_builtins): Update call to build_common_builtin_nodes. gcc/ada/ * gcc-interface/utils.c (gnat_install_builtins): Update call to build_common_builtin_nodes. gcc/cp/ * cp-objcp-common.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New. gcc/fortran/ * f95-lang.c (gfc_init_builtin_functions): Update call to build_common_builtin_nodes. gcc/java/ * builtins.c (initialize_builtins): Update call to build_common_builtin_nodes. * lang.c (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152241 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/builtins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/java/builtins.c') diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index a05ff53ceb9..6e4815beeab 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -584,7 +584,7 @@ initialize_builtins (void) build_function_type_list (ptr_type_node, int_type_node, NULL_TREE), "__builtin_return_address", BUILTIN_NOTHROW); - build_common_builtin_nodes (true); + build_common_builtin_nodes (); } /* If the call matches a builtin, return the -- cgit v1.2.1 From ff9ddbc50d2773d25300aa8a2a5ba56d9c1a8060 Mon Sep 17 00:00:00 2001 From: jakub Date: Sat, 28 Nov 2009 16:21:52 +0000 Subject: * jvspec.c (lang_specific_driver): Remove unused saw_verbose_flag variable. * jcf-dump.c (main): Remove unused general_purpose_bits variable. * builtins.c (initialize_builtins): Remove unused float_ftype_float variable. * expr.c (java_stack_pop): Remove unused val variable. (build_jni_stub): Remove unused res_type variable. * verify-impl.c (check_field_constant): Remove unused len variable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154727 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/builtins.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gcc/java/builtins.c') diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index 6e4815beeab..099b9e00cd8 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -484,7 +484,7 @@ void initialize_builtins (void) { tree double_ftype_double, double_ftype_double_double; - tree float_ftype_float, float_ftype_float_float; + tree float_ftype_float_float; tree boolean_ftype_boolean_boolean; tree t; int i; @@ -501,7 +501,6 @@ initialize_builtins (void) void_list_node = end_params_node; t = tree_cons (NULL_TREE, float_type_node, end_params_node); - float_ftype_float = build_function_type (float_type_node, t); t = tree_cons (NULL_TREE, float_type_node, t); float_ftype_float_float = build_function_type (float_type_node, t); -- cgit v1.2.1 From 4081d362fba108e17784f385774bfae44e2dcee2 Mon Sep 17 00:00:00 2001 From: jakub Date: Wed, 7 Apr 2010 20:27:37 +0000 Subject: * tree-ssa-pre.c (my_rev_post_order_compute): Remove set but not used count variable. * genemit.c (gen_expand, gen_split): Avoid set but not used warnings when operandN variables aren't used in the body of the expander or splitter. * tree-outof-ssa.c (FOR_EACH_ELIM_GRAPH_SUCC, FOR_EACH_ELIM_GRAPH_PRED): Avoid set but not used warnings. * tree-ssa-operands.h (FOR_EACH_SSA_TREE_OPERAND): Likewise. * tree-flow.h (FOR_EACH_IMM_USE_FAST, FOR_EACH_IMM_USE_STMT, FOR_EACH_IMM_USE_ON_STMT): Likewise. * tree.h (FOR_EACH_CONSTRUCTOR_ELT): Likewise. * tree.c (PROCESS_ARG): Likewise. fortran/ * parse.c (parse_derived, parse_enum): Avoid set but not used warning. java/ * expr.c (process_jvm_instruction): Avoid set but not used warning. * builtins.c (compareAndSwapInt_builtin, compareAndSwapLong_builtin, getVolatile_builtin): Likewise. libjava/ * exception.cc (_Jv_Throw): Avoid set but not used warning. * include/java-assert.h (JvAssertMessage, JvAssert): Use argument in sizeof to avoid set but not used warnings. libjava/classpath/ * native/jni/midi-alsa/gnu_javax_sound_midi_alsa_AlsaPortDevice.c (Java_gnu_javax_sound_midi_alsa_AlsaPortDevice_run_1receiver_1thread_1): Avoid set but not used warning. libiberty/ * regex.c (byte_re_match_2_internal): Avoid set but not used warning. gcc/testsuite/ * gcc.dg/builtin-choose-expr.c: Avoid set but not used warnings. * gcc.dg/trunc-1.c: Likewise. * gcc.dg/vla-9.c: Likewise. * gcc.dg/dfp/composite-type.c: Likewise. libffi/ * testsuite/libffi.call/err_bad_abi.c: Remove unused args variable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158084 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/builtins.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/java/builtins.c') diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index 099b9e00cd8..a4f59f9fa7f 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -1,5 +1,5 @@ /* Built-in and inline functions for gcj - Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2009 + Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -323,6 +323,7 @@ compareAndSwapInt_builtin (tree method_return_type ATTRIBUTE_UNUSED, { tree addr, stmt; UNMARSHAL5 (orig_call); + (void) value_type; /* Avoid set but not used warning. */ addr = build_addr_sum (int_type_node, obj_arg, offset_arg); stmt = build_call_expr (built_in_decls[BUILT_IN_BOOL_COMPARE_AND_SWAP_4], @@ -347,6 +348,7 @@ compareAndSwapLong_builtin (tree method_return_type ATTRIBUTE_UNUSED, { tree addr, stmt; UNMARSHAL5 (orig_call); + (void) value_type; /* Avoid set but not used warning. */ addr = build_addr_sum (long_type_node, obj_arg, offset_arg); stmt = build_call_expr (built_in_decls[BUILT_IN_BOOL_COMPARE_AND_SWAP_8], @@ -410,7 +412,8 @@ getVolatile_builtin (tree method_return_type ATTRIBUTE_UNUSED, { tree addr, stmt, modify_stmt, tmp; UNMARSHAL3 (orig_call); - + (void) this_arg; /* Avoid set but not used warning. */ + addr = build_addr_sum (method_return_type, obj_arg, offset_arg); addr = fold_convert (build_pointer_type (build_type_variant -- cgit v1.2.1 From 3484143b5879162ba1779358e3da4622e8930d7f Mon Sep 17 00:00:00 2001 From: steven Date: Sun, 23 May 2010 17:48:41 +0000 Subject: * java-gimplify.c: Do not include tm.h, toplev.h. * typeck.c: Do not include tm.h. * mangle_name.c: Do not include tm.h. * jcf-dump.c: Do not include tm.h, ggc.h. * class.c: Do not include rtl.h, tm_p.h, target.h, except.h, cgraph.h. * decl.c: Do not include tm.h, rtl.h, function.h, expr.h, except.h, and timevar.h. * jcf-parse.c: Do not include tm.h and tm_p.h. * resource.c: Do not include tm.h, rtl.h, flags.h, obstack.h, target.h, and expr.h. * except.c: Do not include tm.h, rtl.h, function.h. * builtins.c: Do not include convert.h. Explain why RTL headers have to be included here. * verify-glue.c: Do not include tm.h. * jcf-depend.c: Do not include tm.h. * jcf-reader.c: Include ggc.h. * jcf-io.c: Do not include tm.h, toplev.h. * expr.c: Do not include tm.h, rtl.h, expr.h, except.h, tm_p.h, gimple.h. * lang.c: Do not include rtl.h, expr.h. * Make-lang.in: Update dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159764 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/builtins.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/java/builtins.c') diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index a4f59f9fa7f..a3658058a55 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -34,7 +34,9 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "langhooks.h" #include "java-tree.h" #include -#include "convert.h" + +/* FIXME: All these headers are necessary for sync_compare_and_swap. + Front ends should never have to look at that. */ #include "rtl.h" #include "insn-codes.h" #include "expr.h" -- cgit v1.2.1 From 141acd01436bc952a91b63a4c98a3dc49256989e Mon Sep 17 00:00:00 2001 From: steven Date: Thu, 27 May 2010 16:02:50 +0000 Subject: gcc/ChangeLog: * Makefile.in (ALL_CFLAGS): Add file-specific CFLAGS. (ALL_HOST_FRONTEND_OBJS): New, for all front-end specific objects. (ALL_HOST_BACKEND_OBJS): New, for all backend and target objects. (ALL_HOST_OBJS): Now a union of the above two.
: Add -DIN_GCC_FRONTEND for all files in ALL_HOST_FRONTEND_OBJS. * system.h: Poison GCC_RTL_H if IN_GCC_FRONTEND is defined. * c-common.c: Pretend to be a backend file by undefining IN_GCC_FRONTEND (still need rtl.h here). ada/ChangeLog: * gcc-interface/decl.c: Pretend to be a backend file by undefining IN_GCC_FRONTEND (still need rtl.h here). java/ChangeLog: * buildings.c: Pretend to be a backend file by undefining IN_GCC_FRONTEND (still need rtl.h here). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159927 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/builtins.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/java/builtins.c') diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index a3658058a55..74859411758 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -24,6 +24,9 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ /* Written by Tom Tromey . */ +/* FIXME: Still need to include rtl.h here (see below). */ +#undef IN_GCC_FRONTEND + #include "config.h" #include "system.h" #include "coretypes.h" -- cgit v1.2.1 From 6b53160639f10dae0b019bc8a0cafb18eca4d230 Mon Sep 17 00:00:00 2001 From: rsandifo Date: Sun, 4 Jul 2010 22:14:56 +0000 Subject: gcc/ * optabs.h (reload_in_optab, reload_out_optab, code_to_optab) (vcond_gen_code, vcondu_gen_code, movmem_optab, setmem_optab) (cmpstr_optab, cmpstrn_optab, cmpmem_optab, sync_add_optab) (sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab) (sync_nand_optab, sync_old_add_optab, sync_old_sub_optab) (sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab) (sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab) (sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab) (sync_new_nand_optab): Redefine as macros. (sync_compare_and_swap, sync_lock_test_and_set, sync_lock_release): Delete. (direct_optab_index): New enum. (direct_optab_d): New structure. (direct_optab): New typedef. (direct_optab_table): Declare. (direct_optab_handler, set_direct_optab_handler): New functions. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab) (sync_lock_release_optab): New macros. * optabs.c (direct_optab_table): New variable. (movcc_gen_code, vcond_gen_code, vcondu_gen_code): Delete. (prepare_cmp_insn): Use direct_optab_handler for cmpmem_optab, cmpstr_optab and cmpstrn_optab. (emit_conditional_move): Likewise for movcc_optab. (can_conditionally_move_p): Likewise for movcc_gen_code. (init_insn_codes): Clear direct_optab_table. (init_optabs): Don't initialize the new "direct optabs" here. (get_vcond_icode): Use direct_optab_handler for vcondu_gen_code and vcond_gen_code. (expand_val_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_bool_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_compare_and_swap_loop): Likewise sync_compare_and_swap_optab. (expand_sync_operation): Likewise other sync_*_optabs. (expand_sync_fetch_operation): Likewise. Rename sync_compare_and_swap to sync_compare_and_swap_optab. (expand_sync_lock_test_and_set): Use direct_optab_handler for sync_lock_test_and_set and sync_compare_and_swap, adding "_optab" to the names of both. * builtins.c (expand_builtin_strcmp): Use direct_optab_handler for cmpstr_optab and cmpstrn_optab. (expand_builtin_lock_release): Likewise sync_lock_release. * expr.c (movmem_optab, setmem_optab, cmpstr_optab, cmpstrn_optab) (cmpmem_optab, sync_add_optab, sync_sub_optab, sync_ior_optab) (sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab) (sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab) (sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab) (sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab) (sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap) (sync_lock_test_and_set, sync_lock_release): Delete. (emit_block_move_via_movmem): Use direct_optab_handler for movmem_optab. (emit_block_move_via_setmem): Use direct_optab_handler for setmem_optab. * genopinit.c (optabs): Use set_direct_optab_handler for the new macro optabs. * omp-low.c (expand_omp_atomic_fetch_op): Update the type of the "optab" local variable. Use direct_optab_handler for optab and sync_compare_and_swap_optab. * reload1.c (reload_in_optab, reload_out_optab): Delete. * targhooks.c (default_secondary_reload): Use direct_optab_handler for reload_in_optab and reload_out_optab. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_alloc_temp_reg): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * java/builtins.c (compareAndSwapInt_builtin): Use direct_optab_handler for sync_compare_and_swap, renaming it to sync_compare_and_swap_optab. (compareAndSwapLong_builtin, compareAndSwapObject_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161810 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/builtins.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gcc/java/builtins.c') diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index 74859411758..527c4e6fb9a 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -323,7 +323,8 @@ compareAndSwapInt_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree orig_call) { enum machine_mode mode = TYPE_MODE (int_type_node); - if (sync_compare_and_swap[mode] != CODE_FOR_nothing + if (direct_optab_handler (sync_compare_and_swap_optab, mode) + != CODE_FOR_nothing || flag_use_atomic_builtins) { tree addr, stmt; @@ -344,7 +345,8 @@ compareAndSwapLong_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree orig_call) { enum machine_mode mode = TYPE_MODE (long_type_node); - if (sync_compare_and_swap[mode] != CODE_FOR_nothing + if (direct_optab_handler (sync_compare_and_swap_optab, mode) + != CODE_FOR_nothing || (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (word_mode) && flag_use_atomic_builtins)) /* We don't trust flag_use_atomic_builtins for multi-word @@ -368,7 +370,8 @@ compareAndSwapObject_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree orig_call) { enum machine_mode mode = TYPE_MODE (ptr_type_node); - if (sync_compare_and_swap[mode] != CODE_FOR_nothing + if (direct_optab_handler (sync_compare_and_swap_optab, mode) + != CODE_FOR_nothing || flag_use_atomic_builtins) { tree addr, stmt; @@ -448,7 +451,8 @@ VMSupportsCS8_builtin (tree method_return_type, { enum machine_mode mode = TYPE_MODE (long_type_node); gcc_assert (method_return_type == boolean_type_node); - if (sync_compare_and_swap[mode] != CODE_FOR_nothing) + if (direct_optab_handler (sync_compare_and_swap_optab, mode) + != CODE_FOR_nothing) return boolean_true_node; else return boolean_false_node; -- cgit v1.2.1