@@ -6681,6 +6681,13 @@ arm_function_ok_for_sibcall (tree decl, tree exp)
register. */
rtx a, b;
+ /* If it is an indirect function pointer, get the function type. */
+ if (!decl
+ && POINTER_TYPE_P (TREE_TYPE (CALL_EXPR_FN (exp)))
+ && (TREE_CODE (TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (exp))))
+ == FUNCTION_TYPE))
+ decl = TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (exp)));
+
a = arm_function_value (TREE_TYPE (exp), decl, false);
b = arm_function_value (TREE_TYPE (DECL_RESULT (cfun->decl)),
cfun->decl, false);