diff options
Diffstat (limited to 'gcc/calls.cc')
-rw-r--r-- | gcc/calls.cc | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/gcc/calls.cc b/gcc/calls.cc index 372fab3..e16190c 100644 --- a/gcc/calls.cc +++ b/gcc/calls.cc @@ -1273,11 +1273,6 @@ void maybe_complain_about_tail_call (tree call_expr, const char *reason) { gcc_assert (TREE_CODE (call_expr) == CALL_EXPR); - if (CALL_EXPR_MUST_TAIL_CALL (call_expr)) - { - error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason); - CALL_EXPR_MUST_TAIL_CALL (call_expr) = 0; - } if (CALL_EXPR_TAILCALL (call_expr) && dump_file && (dump_flags & TDF_DETAILS)) @@ -1286,6 +1281,11 @@ maybe_complain_about_tail_call (tree call_expr, const char *reason) print_generic_expr (dump_file, call_expr, TDF_SLIM); fprintf (dump_file, "\n"); } + if (CALL_EXPR_MUST_TAIL_CALL (call_expr)) + { + error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason); + CALL_EXPR_MUST_TAIL_CALL (call_expr) = 0; + } } /* Fill in ARGS_SIZE and ARGS array based on the parameters found in @@ -1382,6 +1382,11 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, } } + bool promote_p + = targetm.calls.promote_prototypes (fndecl + ? TREE_TYPE (fndecl) + : fntype); + /* I counts args in order (to be) pushed; ARGPOS counts in order written. */ for (argpos = 0; argpos < num_actuals; i--, argpos++) { @@ -1391,6 +1396,10 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, /* Replace erroneous argument with constant zero. */ if (type == error_mark_node || !COMPLETE_TYPE_P (type)) args[i].tree_value = integer_zero_node, type = integer_type_node; + else if (promote_p + && INTEGRAL_TYPE_P (type) + && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)) + type = integer_type_node; /* If TYPE is a transparent union or record, pass things the way we would pass the first field of the union or record. We have @@ -3727,19 +3736,16 @@ expand_call (tree exp, rtx target, int ignore) next_arg_reg, valreg, old_inhibit_defer_pop, call_fusage, flags, args_so_far); - if (flag_ipa_ra) + rtx_call_insn *last; + rtx datum = NULL_RTX; + if (fndecl != NULL_TREE) { - rtx_call_insn *last; - rtx datum = NULL_RTX; - if (fndecl != NULL_TREE) - { - datum = XEXP (DECL_RTL (fndecl), 0); - gcc_assert (datum != NULL_RTX - && GET_CODE (datum) == SYMBOL_REF); - } - last = last_call_insn (); - add_reg_note (last, REG_CALL_DECL, datum); + datum = XEXP (DECL_RTL (fndecl), 0); + gcc_assert (datum != NULL_RTX + && GET_CODE (datum) == SYMBOL_REF); } + last = last_call_insn (); + add_reg_note (last, REG_CALL_DECL, datum); /* If the call setup or the call itself overlaps with anything of the argument setup we probably clobbered our call address. @@ -3781,8 +3787,7 @@ expand_call (tree exp, rtx target, int ignore) add_reg_note (last, REG_NOALIAS, temp); /* Write out the sequence. */ - insns = get_insns (); - end_sequence (); + insns = end_sequence (); emit_insn (insns); valreg = temp; } @@ -3998,8 +4003,7 @@ expand_call (tree exp, rtx target, int ignore) targetm.calls.end_call_args (args_so_far); - insns = get_insns (); - end_sequence (); + insns = end_sequence (); if (pass == 0) { @@ -4797,13 +4801,10 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, struct_value_size, call_cookie, valreg, old_inhibit_defer_pop + 1, call_fusage, flags, args_so_far); - if (flag_ipa_ra) - { - rtx datum = orgfun; - gcc_assert (GET_CODE (datum) == SYMBOL_REF); - rtx_call_insn *last = last_call_insn (); - add_reg_note (last, REG_CALL_DECL, datum); - } + rtx datum = orgfun; + gcc_assert (GET_CODE (datum) == SYMBOL_REF); + rtx_call_insn *last = last_call_insn (); + add_reg_note (last, REG_CALL_DECL, datum); /* Right-shift returned value if necessary. */ if (!pcc_struct_value |