diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1997-04-22 15:19:47 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1997-04-22 15:19:47 -0700 |
commit | f76b8156d996d6489f1279514e2ea4fcf39069f6 (patch) | |
tree | dfb47016797c8d34bff77af2a5ebf3f0c05cf2b7 /gcc | |
parent | 6c0870b8965075ed5cef38bc90a6992febec95a5 (diff) | |
download | gcc-f76b8156d996d6489f1279514e2ea4fcf39069f6.zip gcc-f76b8156d996d6489f1279514e2ea4fcf39069f6.tar.gz gcc-f76b8156d996d6489f1279514e2ea4fcf39069f6.tar.bz2 |
(gen_variable_dir): Add test for DW_AT_declaration to the old_die if statement, and delete assertion for it.
(gen_variable_dir): Add test for DW_AT_declaration to
the old_die if statement, and delete assertion for it.
(decl_ultimate_origin): Remove last change.
From-SVN: r13956
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/dwarf2out.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 1341ed7..c30785f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -1998,7 +1998,7 @@ decl_ultimate_origin (decl) { register tree immediate_origin = DECL_ABSTRACT_ORIGIN (decl); - if (immediate_origin == NULL_TREE || immediate_origin == decl) + if (immediate_origin == NULL_TREE) return NULL_TREE; else { @@ -7453,9 +7453,15 @@ gen_variable_die (decl, context_die) if (origin != NULL) add_abstract_origin_attribute (var_die, origin); - else if (old_die && TREE_STATIC (decl)) - { - assert (get_AT_flag (old_die, DW_AT_declaration) == 1); + /* Loop unrolling can create multiple blocks that refer to the same + static variable, so we must test for the DW_AT_declaration flag. */ + /* ??? Loop unrolling/reorder_blocks should perhaps be rewritten to + copy decls and set the DECL_ABSTRACT flag on them instead of + sharing them. */ + else if (old_die && TREE_STATIC (decl) + && get_AT_flag (old_die, DW_AT_declaration) == 1) + { + /* ??? This is an instantiation of a C++ class level static. */ add_AT_die_ref (var_die, DW_AT_specification, old_die); if (DECL_NAME (decl)) { |