summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-18 19:41:45 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-18 19:41:45 +0000
commit32f1135b85ee4fb2a9d9369c67bbe6b9e671c8b4 (patch)
tree7d6838db4a2be2cf87c54bbf40d6295a8d5d8339 /gcc/tree.c
parent29211303d610739b4bf31d9c61270439832b1b7d (diff)
downloadgcc-32f1135b85ee4fb2a9d9369c67bbe6b9e671c8b4.tar.gz
PR middle-end/49675
* tree.c (build_common_builtin_nodes): Register __builtin_return_address, __cyg_profile_func_enter and __cyg_profile_func_exit. * gfortran.dg/pr49675.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176417 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 10f50de8a52..8c44851a18b 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -9546,6 +9546,31 @@ build_common_builtin_nodes (void)
? "_Unwind_SjLj_Resume" : "_Unwind_Resume"),
ECF_NORETURN);
+ if (built_in_decls[BUILT_IN_RETURN_ADDRESS] == NULL_TREE)
+ {
+ ftype = build_function_type_list (ptr_type_node, integer_type_node,
+ NULL_TREE);
+ local_define_builtin ("__builtin_return_address", ftype,
+ BUILT_IN_RETURN_ADDRESS,
+ "__builtin_return_address",
+ ECF_NOTHROW);
+ }
+
+ if (built_in_decls[BUILT_IN_PROFILE_FUNC_ENTER] == NULL_TREE
+ || built_in_decls[BUILT_IN_PROFILE_FUNC_EXIT] == NULL_TREE)
+ {
+ ftype = build_function_type_list (void_type_node, ptr_type_node,
+ ptr_type_node, NULL_TREE);
+ if (built_in_decls[BUILT_IN_PROFILE_FUNC_ENTER] == NULL_TREE)
+ local_define_builtin ("__cyg_profile_func_enter", ftype,
+ BUILT_IN_PROFILE_FUNC_ENTER,
+ "__cyg_profile_func_enter", 0);
+ if (built_in_decls[BUILT_IN_PROFILE_FUNC_EXIT] == NULL_TREE)
+ local_define_builtin ("__cyg_profile_func_exit", ftype,
+ BUILT_IN_PROFILE_FUNC_EXIT,
+ "__cyg_profile_func_exit", 0);
+ }
+
/* The exception object and filter values from the runtime. The argument
must be zero before exception lowering, i.e. from the front end. After
exception lowering, it will be the region number for the exception