diff options
author | Jim Wilson <wilson@cygnus.com> | 1998-04-29 13:47:28 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1998-04-29 06:47:28 -0700 |
commit | 0c84c6183433da16ca1062e0accb15b5f3abd664 (patch) | |
tree | f98b35b4f7042fadaf01aadb78773d5a2fafc620 /gcc | |
parent | bf5f0e909897688eec9f4f70eb88a805764675f1 (diff) | |
download | gcc-0c84c6183433da16ca1062e0accb15b5f3abd664.zip gcc-0c84c6183433da16ca1062e0accb15b5f3abd664.tar.gz gcc-0c84c6183433da16ca1062e0accb15b5f3abd664.tar.bz2 |
Fix dwarf2 abort while compiling mips simulator, reported by Michael Tiemann.
* dwarf2out.c (scope_die_for): If could not find proper scope,
check for and handle tagged type with incorrect TYPE_CONTEXT.
From-SVN: r19493
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 341de00..42f7119 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Wed Apr 29 13:46:03 1998 Jim Wilson <wilson@cygnus.com> + + * dwarf2out.c (scope_die_for): If could not find proper scope, + check for and handle tagged type with incorrect TYPE_CONTEXT. + Wed Apr 29 15:34:40 1998 John Carr <jfc@mit.edu> * calls.c (expand_call): Fix recognition of C++ operator new. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 5ee4a90..71f2ec0 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -7577,6 +7577,24 @@ scope_die_for (t, context_die) i = decl_scope_table[i].previous)) ; + /* ??? Integrate_decl_tree does not handle BLOCK_TYPE_TAGS, nor + does it try to handle types defined by TYPE_DECLs. Such types + thus have an incorrect TYPE_CONTEXT, which points to the block + they were originally defined in, instead of the current block + created by function inlining. We try to detect that here and + work around it. */ + + if (i < 0 && scope_die == comp_unit_die + && TREE_CODE (containing_scope) == BLOCK + && is_tagged_type (t) + && (block_ultimate_origin (decl_scope_table[decl_scope_depth - 1].scope) + == containing_scope)) + { + scope_die = context_die; + /* Since the checks below are no longer applicable. */ + i = 0; + } + if (i < 0) { if (scope_die != comp_unit_die |