aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1997-03-06 13:32:43 -0800
committerJim Wilson <wilson@gcc.gnu.org>1997-03-06 13:32:43 -0800
commitdfcf98915cfd438777af1990365da4d50b3d0328 (patch)
tree7bcb0f3c23ac1a9920b187e1764f03609e632dcc
parentb1357021b832988e12895b1fa3ca6a24c1677009 (diff)
downloadgcc-dfcf98915cfd438777af1990365da4d50b3d0328.zip
gcc-dfcf98915cfd438777af1990365da4d50b3d0328.tar.gz
gcc-dfcf98915cfd438777af1990365da4d50b3d0328.tar.bz2
(modified_type_die): Initialize item_type to NULL.
Move equate_type_number_to_die call before use of sub_die, and move recursive modified_type_die calls on item_type after it. From-SVN: r13694
-rw-r--r--gcc/dwarf2out.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 6d79f54..1f108df 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -5194,7 +5194,7 @@ modified_type_die (type, is_const_type, is_volatile_type, context_die)
register enum tree_code code = TREE_CODE (type);
register dw_die_ref mod_type_die = NULL;
register dw_die_ref sub_die = NULL;
- register tree item_type;
+ register tree item_type = NULL;
if (code != ERROR_MARK)
{
@@ -5245,10 +5245,6 @@ modified_type_die (type, is_const_type, is_volatile_type, context_die)
add_AT_unsigned (mod_type_die, DW_AT_address_class, 0);
#endif
item_type = TREE_TYPE (type);
- sub_die = modified_type_die (item_type,
- TYPE_READONLY (item_type),
- TYPE_VOLATILE (item_type),
- context_die);
}
else if (code == REFERENCE_TYPE)
{
@@ -5258,10 +5254,6 @@ modified_type_die (type, is_const_type, is_volatile_type, context_die)
add_AT_unsigned (mod_type_die, DW_AT_address_class, 0);
#endif
item_type = TREE_TYPE (type);
- sub_die = modified_type_die (item_type,
- TYPE_READONLY (item_type),
- TYPE_VOLATILE (item_type),
- context_die);
}
else if (is_base_type (type))
{
@@ -5281,11 +5273,22 @@ modified_type_die (type, is_const_type, is_volatile_type, context_die)
assert (mod_type_die != NULL);
}
}
+ equate_type_number_to_die (type, mod_type_die);
+ if (item_type)
+ {
+ /* We must do this after the equate_type_number_to_die call, in case
+ this is a recursive type. This ensures that the modified_type_die
+ recursion will terminate even if the type is recursive. Recursive
+ types are possible in Ada. */
+ sub_die = modified_type_die (item_type,
+ TYPE_READONLY (item_type),
+ TYPE_VOLATILE (item_type),
+ context_die);
+ }
if (sub_die != NULL)
{
add_AT_die_ref (mod_type_die, DW_AT_type, sub_die);
}
- equate_type_number_to_die (type, mod_type_die);
return mod_type_die;
}