aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@casey.cygnus.com>2000-02-04 23:46:13 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-02-04 18:46:13 -0500
commite40a1c67653733936e2b0ffa7a8b7eb94c5c8833 (patch)
tree75c68bf0fdf7acda40550012ae30cd3a5d140ec5
parenta5fa648417fbb86cb06802f99ad1ed436fde4cd3 (diff)
downloadgcc-e40a1c67653733936e2b0ffa7a8b7eb94c5c8833.zip
gcc-e40a1c67653733936e2b0ffa7a8b7eb94c5c8833.tar.gz
gcc-e40a1c67653733936e2b0ffa7a8b7eb94c5c8833.tar.bz2
dwarf2out.c (add_abstract_origin_attribute): Don't call gen_abstract_function on our context if we're a nested function.
* dwarf2out.c (add_abstract_origin_attribute): Don't call gen_abstract_function on our context if we're a nested function. From-SVN: r31798
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/dwarf2out.c18
2 files changed, 17 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 70170c3..f13535e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-02-04 Jason Merrill <jason@casey.cygnus.com>
+
+ * dwarf2out.c (add_abstract_origin_attribute): Don't call
+ gen_abstract_function on our context if we're a nested function.
+
2000-02-05 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.md (fixuns_truncqfqi2): Rewrite.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 2ca007a4..fdc6448 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -7374,12 +7374,18 @@ add_abstract_origin_attribute (die, origin)
{
dw_die_ref origin_die = NULL;
- /* We may have gotten separated from the block for the inlined
- function, if we're in an exception handler or some such; make
- sure that the abstract function has been written out. */
- tree fn = decl_function_context (origin);
- if (fn)
- gen_abstract_function (fn);
+ if (die->die_tag != DW_TAG_subprogram)
+ {
+ /* We may have gotten separated from the block for the inlined
+ function, if we're in an exception handler or some such; make
+ sure that the abstract function has been written out.
+
+ Doing this for nested functions is wrong, however; functions are
+ distinct units, and our context might not even be inline. */
+ tree fn = decl_function_context (origin);
+ if (fn)
+ gen_abstract_function (fn);
+ }
if (TREE_CODE_CLASS (TREE_CODE (origin)) == 'd')
origin_die = lookup_decl_die (origin);