summaryrefslogtreecommitdiff
path: root/gcc/internal-fn.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-28 08:27:18 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-28 08:27:18 +0000
commit5a5ef6591c05aeaa6dfe4cc37711b5519380b37a (patch)
tree532f4d56f6e6da5f9c6f2a7cf4ae65a7b9a8342d /gcc/internal-fn.c
parent1fcfb8f7ac7dcd6c506182d5bd9d11f3caf76d98 (diff)
downloadgcc-5a5ef6591c05aeaa6dfe4cc37711b5519380b37a.tar.gz
PR middle-end/66867
* builtins.c (expand_ifn_atomic_compare_exchange_into_call, expand_ifn_atomic_compare_exchange): New functions. * internal-fn.c (expand_ATOMIC_COMPARE_EXCHANGE): New function. * tree.h (build_call_expr_internal_loc): Rename to ... (build_call_expr_internal_loc_array): ... this. Fix up type of last argument. * internal-fn.def (ATOMIC_COMPARE_EXCHANGE): New internal fn. * predict.c (expr_expected_value_1): Handle IMAGPART_EXPR of ATOMIC_COMPARE_EXCHANGE result. * builtins.h (expand_ifn_atomic_compare_exchange): New prototype. * gimple-fold.h (optimize_atomic_compare_exchange_p, fold_builtin_atomic_compare_exchange): New prototypes. * gimple-fold.c (optimize_atomic_compare_exchange_p, fold_builtin_atomic_compare_exchange): New functions.. * tree-ssa.c (execute_update_addresses_taken): If optimize_atomic_compare_exchange_p, ignore &var in 2nd argument of call when finding addressable vars, and if such var becomes non-addressable, call fold_builtin_atomic_compare_exchange. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237814 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/internal-fn.c')
-rw-r--r--gcc/internal-fn.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c
index de850fdb493..5dd813f707a 100644
--- a/gcc/internal-fn.c
+++ b/gcc/internal-fn.c
@@ -2185,6 +2185,14 @@ expand_ATOMIC_BIT_TEST_AND_RESET (internal_fn, gcall *call)
expand_ifn_atomic_bit_test_and (call);
}
+/* Expand atomic bit test and set. */
+
+static void
+expand_ATOMIC_COMPARE_EXCHANGE (internal_fn, gcall *call)
+{
+ expand_ifn_atomic_compare_exchange (call);
+}
+
/* Expand a call to FN using the operands in STMT. FN has a single
output operand and NARGS input operands. */