===================================================================
@@ -24,5 +24,19 @@ int main ()
exit (0);
}
-void __attribute__((no_instrument_function)) __cyg_profile_func_enter(void *this_fn, void *call_site) { }
-void __attribute__((no_instrument_function)) __cyg_profile_func_exit(void *this_fn, void *call_site) { }
+/* Abort on non-NULL CALL_SITE to ensure that __builtin_return_address
+ was expanded properly. */
+void __attribute__((no_instrument_function))
+__cyg_profile_func_enter(void *this_fn, void *call_site)
+{
+ if (call_site == (void *)0)
+ abort ();
+}
+
+void __attribute__((no_instrument_function))
+__cyg_profile_func_exit(void *this_fn, void *call_site)
+{
+ if (call_site == (void *)0)
+ abort ();
+}
+
===================================================================
@@ -7868,7 +7868,7 @@ gimplify_function_tree (tree fndecl)
gimple call;
x = implicit_built_in_decls[BUILT_IN_RETURN_ADDRESS];
- call = gimple_build_call (x, 0);
+ call = gimple_build_call (x, 1, integer_zero_node);
tmp_var = create_tmp_var (ptr_type_node, "return_addr");
gimple_call_set_lhs (call, tmp_var);
gimplify_seq_add_stmt (&cleanup, call);
@@ -7880,7 +7880,7 @@ gimplify_function_tree (tree fndecl)
tf = gimple_build_try (seq, cleanup, GIMPLE_TRY_FINALLY);
x = implicit_built_in_decls[BUILT_IN_RETURN_ADDRESS];
- call = gimple_build_call (x, 0);
+ call = gimple_build_call (x, 1, integer_zero_node);
tmp_var = create_tmp_var (ptr_type_node, "return_addr");
gimple_call_set_lhs (call, tmp_var);
gimplify_seq_add_stmt (&body, call);