aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-07-18 21:41:45 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-07-18 21:41:45 +0200
commit8b316874a1c1c823d97d7575039b726e4202f681 (patch)
tree7d6838db4a2be2cf87c54bbf40d6295a8d5d8339 /gcc
parent9f68560b1359ee9c2011f5017f8e884af30f24e7 (diff)
downloadgcc-8b316874a1c1c823d97d7575039b726e4202f681.zip
gcc-8b316874a1c1c823d97d7575039b726e4202f681.tar.gz
gcc-8b316874a1c1c823d97d7575039b726e4202f681.tar.bz2
re PR middle-end/49675 (ICE (segfault) with -finstrument-functions)
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. From-SVN: r176417
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/pr49675.f906
-rw-r--r--gcc/tree.c25
4 files changed, 43 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4bfd455..8a30143 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/49675
+ * tree.c (build_common_builtin_nodes): Register
+ __builtin_return_address, __cyg_profile_func_enter
+ and __cyg_profile_func_exit.
+
2011-07-18 Richard Henderson <rth@redhat.com>
* bb-reorder.c (emit_barrier_after_bb): Split out of ...
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 32f59bd..03b4441 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/49675
+ * gfortran.dg/pr49675.f90: New test.
+
2011-07-18 Richard Guenther <rguenther@suse.de>
* gcc.dg/torture/20110718-1.c: New testcase.
diff --git a/gcc/testsuite/gfortran.dg/pr49675.f90 b/gcc/testsuite/gfortran.dg/pr49675.f90
new file mode 100644
index 0000000..06fd1b6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr49675.f90
@@ -0,0 +1,6 @@
+! PR middle-end/49675
+! { dg-do compile }
+! { dg-options "-finstrument-functions" }
+end
+! { dg-final { scan-assembler "__cyg_profile_func_enter" } }
+! { dg-final { scan-assembler "__cyg_profile_func_exit" } }
diff --git a/gcc/tree.c b/gcc/tree.c
index 10f50de..8c44851 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