diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2006-09-13 18:40:26 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2006-09-13 18:40:26 +0000 |
commit | efaa616eeb3b3cc2cbe664ba9305d3035fb2d2d9 (patch) | |
tree | 1209ab556421fad1e3fc3a74d1d777793febdb43 /gcc/ada/decl.c | |
parent | 2655f1c6dd3b1a1db7453065a0bb67f30d4552ad (diff) | |
download | gcc-efaa616eeb3b3cc2cbe664ba9305d3035fb2d2d9.zip gcc-efaa616eeb3b3cc2cbe664ba9305d3035fb2d2d9.tar.gz gcc-efaa616eeb3b3cc2cbe664ba9305d3035fb2d2d9.tar.bz2 |
re PR ada/28591 (ICE in splice_child_die, at dwarf2out.c:5513)
PR ada/28591
* decl.c (components_to_record): Defer emitting debug info for the
record type associated with the variant until after we are sure to
actually use it.
From-SVN: r116928
Diffstat (limited to 'gcc/ada/decl.c')
-rw-r--r-- | gcc/ada/decl.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index 6a8f234..6d70a15 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -5659,10 +5659,12 @@ components_to_record (tree gnu_record_type, Node_Id component_list, = TYPE_SIZE_UNIT (gnu_record_type); } + /* Create the record for the variant. Note that we defer emitting + debug info for it until after we are sure to actually use it. */ components_to_record (gnu_variant_type, Component_List (variant), NULL_TREE, packed, definition, &gnu_our_rep_list, !all_rep_and_size, all_rep, - false, unchecked_union); + true, unchecked_union); gnu_qual = choices_to_gnu (gnu_discriminant, Discrete_Choices (variant)); @@ -5676,6 +5678,13 @@ components_to_record (tree gnu_record_type, Node_Id component_list, gnu_field = TYPE_FIELDS (gnu_variant_type); else { + /* Emit debug info for the record. We used to throw away + empty records but we no longer do that because we need + them to generate complete debug info for the variant; + otherwise, the union type definition will be lacking + the fields associated with these empty variants. */ + write_record_type_debug_info (gnu_variant_type); + gnu_field = create_field_decl (gnu_inner_name, gnu_variant_type, gnu_union_type, 0, (all_rep_and_size @@ -5695,12 +5704,6 @@ components_to_record (tree gnu_record_type, Node_Id component_list, gnu_variant_list = gnu_field; } - /* We used to delete the empty variants from the end. However, - we no longer do that because we need them to generate complete - debugging information for the variant record. Otherwise, - the union type definition will be missing the fields associated - to these empty variants. */ - /* Only make the QUAL_UNION_TYPE if there are any non-empty variants. */ if (gnu_variant_list) { |