+2006-10-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/28924
+ * builtins.c (expand_builtin_sync_operation,
+ expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set):
+ Use convert_to_mode to handle promoted arguments.
+
2006-10-06 J"orn Rennecke <joern.rennecke@st.com>
* print-tree.c (print_node_brief, print_node): Print sign of Inf.
arglist = TREE_CHAIN (arglist);
val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL);
+ /* If VAL is promoted to a wider mode, convert it back to MODE. */
+ val = convert_to_mode (mode, val, 1);
if (ignore)
return expand_sync_operation (mem, val, code);
arglist = TREE_CHAIN (arglist);
old_val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL);
+ /* If OLD_VAL is promoted to a wider mode, convert it back to MODE. */
+ old_val = convert_to_mode (mode, old_val, 1);
arglist = TREE_CHAIN (arglist);
new_val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL);
+ /* If NEW_VAL is promoted to a wider mode, convert it back to MODE. */
+ new_val = convert_to_mode (mode, new_val, 1);
if (is_bool)
return expand_bool_compare_and_swap (mem, old_val, new_val, target);
arglist = TREE_CHAIN (arglist);
val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL);
+ /* If VAL is promoted to a wider mode, convert it back to MODE. */
+ val = convert_to_mode (mode, val, 1);
return expand_sync_lock_test_and_set (mem, val, target);
}