On Wed, Dec 6, 2017 at 2:31 PM, DJ Delorie <d...@redhat.com> wrote:
>
> Jason Merrill <ja...@redhat.com> writes:
>> I'm inclined to change the C++ FE to pass NULL_TREE instead until such
>> time as someone cares.
>
> The sh backend will at least not choke on that ;-)

Thus.
commit 301b543f38b687fe5d90010b3c82ef2160362b1b
Author: Jason Merrill <ja...@redhat.com>
Date:   Wed Dec 6 14:33:32 2017 -0500

    Correct argument to targetm.calls.promote_prototypes.
    
            * call.c (convert_for_arg_passing): Pass NULL_TREE to
            targetm.calls.promote_prototypes.
            (type_passed_as): Likewise.

diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e04626863af..bd7666d72bb 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7350,7 +7350,7 @@ type_passed_as (tree type)
       /* There are no other pointers to this temporary.  */
       type = cp_build_qualified_type (type, TYPE_QUAL_RESTRICT);
     }
-  else if (targetm.calls.promote_prototypes (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)))
@@ -7390,7 +7390,7 @@ 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 (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)))

Reply via email to