+2016-08-09 Renlin Li <renlin.li@arm.com>
+
+ PR middle-end/64971
+ * calls.c (prepare_call_address): Convert funexp to Pmode when
+ necessary.
+ * config/aarch64/aarch64.md (sibcall): Remove fix for PR 64971.
+ (sibcall_value): Likewise.
+
2016-08-09 Marek Polacek <polacek@redhat.com>
PR c/7652
&& targetm.small_register_classes_for_mode_p (FUNCTION_MODE))
? force_not_mem (memory_address (FUNCTION_MODE, funexp))
: memory_address (FUNCTION_MODE, funexp));
- else if (! sibcallp)
+ else
{
- if (!NO_FUNCTION_CSE && optimize && ! flag_no_function_cse)
- funexp = force_reg (Pmode, funexp);
+ /* funexp could be a SYMBOL_REF represents a function pointer which is
+ of ptr_mode. In this case, it should be converted into address mode
+ to be a valid address for memory rtx pattern. See PR 64971. */
+ if (GET_MODE (funexp) != Pmode)
+ funexp = convert_memory_address (Pmode, funexp);
+
+ if (! sibcallp)
+ {
+ if (!NO_FUNCTION_CSE && optimize && ! flag_no_function_cse)
+ funexp = force_reg (Pmode, funexp);
+ }
}
if (static_chain_value != 0
|| aarch64_is_noplt_call_p (callee)))
XEXP (operands[0], 0) = force_reg (Pmode, callee);
- /* FIXME: This is a band-aid. Need to analyze why expand_expr_addr_expr
- is generating an SImode symbol reference. See PR 64971. */
- if (TARGET_ILP32
- && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF
- && GET_MODE (XEXP (operands[0], 0)) == SImode)
- XEXP (operands[0], 0) = convert_memory_address (Pmode,
- XEXP (operands[0], 0));
if (operands[2] == NULL_RTX)
operands[2] = const0_rtx;
|| aarch64_is_noplt_call_p (callee)))
XEXP (operands[1], 0) = force_reg (Pmode, callee);
- /* FIXME: This is a band-aid. Need to analyze why expand_expr_addr_expr
- is generating an SImode symbol reference. See PR 64971. */
- if (TARGET_ILP32
- && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
- && GET_MODE (XEXP (operands[1], 0)) == SImode)
- XEXP (operands[1], 0) = convert_memory_address (Pmode,
- XEXP (operands[1], 0));
-
if (operands[3] == NULL_RTX)
operands[3] = const0_rtx;