diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/cp/call.cc | 10 | ||||
-rw-r--r-- | gcc/cp/module.cc | 4 | ||||
-rw-r--r-- | gcc/cp/typeck.cc | 13 |
4 files changed, 21 insertions, 21 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d092553..9d5db06 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,18 @@ +2025-04-27 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/119939 + * module.cc (trees_out::lang_decl_vals): Also stream + lang->u.fn.context when DECL_UNIQUE_FRIEND_P. + (trees_in::lang_decl_vals): Likewise. + +2025-04-27 H.J. Lu <hjl.tools@gmail.com> + + PR middle-end/112877 + * call.cc (type_passed_as): Remove the + targetm.calls.promote_prototypes call. + (convert_for_arg_passing): Likewise. + * typeck.cc (cxx_safe_arg_type_equiv_p): Likewise. + 2025-04-25 Jason Merrill <jason@redhat.com> PR c++/119764 diff --git a/gcc/cp/call.cc b/gcc/cp/call.cc index 6caac89..2c3ef3d 100644 --- a/gcc/cp/call.cc +++ b/gcc/cp/call.cc @@ -9707,11 +9707,6 @@ type_passed_as (tree type) /* Pass classes with copy ctors by invisible reference. */ if (TREE_ADDRESSABLE (type)) type = build_reference_type (type); - else if (targetm.calls.promote_prototypes (NULL_TREE) - && INTEGRAL_TYPE_P (type) - && COMPLETE_TYPE_P (type) - && tree_int_cst_lt (TYPE_SIZE (type), TYPE_SIZE (integer_type_node))) - type = integer_type_node; return type; } @@ -9747,11 +9742,6 @@ convert_for_arg_passing (tree type, tree val, tsubst_flags_t complain) /* Pass classes with copy ctors by invisible reference. */ else if (TREE_ADDRESSABLE (type)) val = build1 (ADDR_EXPR, build_reference_type (type), val); - else if (targetm.calls.promote_prototypes (NULL_TREE) - && INTEGRAL_TYPE_P (type) - && COMPLETE_TYPE_P (type) - && tree_int_cst_lt (TYPE_SIZE (type), TYPE_SIZE (integer_type_node))) - val = cp_perform_integral_promotions (val, complain); if (complain & tf_warning) maybe_warn_parm_abi (type, cp_expr_loc_or_input_loc (val)); diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 5ff5c46..a2e0d6d 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -7386,7 +7386,7 @@ trees_out::lang_decl_vals (tree t) WU (lang->u.fn.ovl_op_code); } - if (DECL_CLASS_SCOPE_P (t)) + if (DECL_CLASS_SCOPE_P (t) || DECL_UNIQUE_FRIEND_P (t)) WT (lang->u.fn.context); if (lang->u.fn.thunk_p) @@ -7470,7 +7470,7 @@ trees_in::lang_decl_vals (tree t) lang->u.fn.ovl_op_code = code; } - if (DECL_CLASS_SCOPE_P (t)) + if (DECL_CLASS_SCOPE_P (t) || DECL_UNIQUE_FRIEND_P (t)) RT (lang->u.fn.context); if (lang->u.fn.thunk_p) diff --git a/gcc/cp/typeck.cc b/gcc/cp/typeck.cc index 88f8f34..1b9fdf5 100644 --- a/gcc/cp/typeck.cc +++ b/gcc/cp/typeck.cc @@ -1372,17 +1372,12 @@ cxx_safe_arg_type_equiv_p (tree t1, tree t2) && TYPE_PTR_P (t2)) return true; - /* The signedness of the parameter matters only when an integral - type smaller than int is promoted to int, otherwise only the - precision of the parameter matters. - This check should make sure that the callee does not see - undefined values in argument registers. */ + /* Only the precision of the parameter matters. This check should + make sure that the callee does not see undefined values in argument + registers. */ if (INTEGRAL_TYPE_P (t1) && INTEGRAL_TYPE_P (t2) - && TYPE_PRECISION (t1) == TYPE_PRECISION (t2) - && (TYPE_UNSIGNED (t1) == TYPE_UNSIGNED (t2) - || !targetm.calls.promote_prototypes (NULL_TREE) - || TYPE_PRECISION (t1) >= TYPE_PRECISION (integer_type_node))) + && TYPE_PRECISION (t1) == TYPE_PRECISION (t2)) return true; return same_type_p (t1, t2); |