This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: dwarf2out change breaks ada
- From: Devang Patel <dpatel at apple dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 28 Jan 2004 11:53:18 -0800
- Subject: Re: dwarf2out change breaks ada
- References: <20040128091442.GA15449@redhat.com>
On Jan 28, 2004, at 1:14 AM, Richard Henderson wrote:
stage1/xgcc -Bstage1/ -B/louie/rth/run/i686-pc-linux-gnu/bin/ -c -g
-O2 -gn
atpg -gnata -I- -I. -Iada -I../../../src-gcc/gcc/ada
../../../src-gcc/gcc/ada/os
int.adb -o ada/osint.o
+===========================GNAT BUG
DETECTED==============================+
| 3.5.0 20040128 (experimental) (i686-pc-linux-gnu) GCC error:
|
| in splice_child_die, at dwarf2out.c:5160
|
| Error detected at osint.ads:570:19
|
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.
|
| Include the entire contents of this bug box in the report.
|
| Include the exact gcc or gnatmake command that you entered.
|
| Also include sources listed below in gnatchop format
|
| (concatenated together with no headers between files).
|
+======================================================================
====+
on i686-linux. I verified that it's this patch along by backing
out the patch and having bootstrap succeed. Please fix.
OK I've fix that lets me pass through this point in bubblestrap. Once
it is
complete, I'll restart full bootstrap for all lang. and run deja-gnu
tests
before posting formal patch to fix this.
here is the fix, but...
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.481
diff -Idpatel.pbxuser -c -3 -p -r1.481 dwarf2out.c
*** dwarf2out.c 27 Jan 2004 20:35:51 -0000 1.481
--- dwarf2out.c 28 Jan 2004 19:41:40 -0000
*************** gen_field_die (tree decl, dw_die_ref con
*** 11188,11196 ****
add_AT_unsigned (decl_die, DW_AT_accessibility,
DW_ACCESS_protected);
else if (TREE_PRIVATE (decl))
add_AT_unsigned (decl_die, DW_AT_accessibility,
DW_ACCESS_private);
-
- /* Equate decl number to die, so that we can look up this decl
later on. */
- equate_decl_number_to_die (decl, decl_die);
}
#if 0
--- 11188,11193 ----
I introduced this two line in my patch. But I feel, that my patch is
just exposing some behavior that I do not understand well.
In dwarf2out.c:gen_member_die() function we have,
11366 /* Now output info about the data members and type members.
*/
11367 for (member = TYPE_FIELDS (type); member; member = TREE_CHAIN
(member))
11368 {
11369 /* If we thought we were generating minimal debug info
for TYPE
11370 and then changed our minds, some of the member
declarations
11371 may have already been defined. Don't define them
again, but
11372 do put them in the right order. */
11373
11374 child = lookup_decl_die (member);
11375 if (child)
11376 splice_child_die (context_die, child);
11377 else
11378 gen_decl_die (member, context_die);
11379 }
Now, we do not record field_decl die with its id in decl_die_table, so
even
though 'member' on line #11374 has one associate die,
lookup_decl_die() does
not find it. Now, in my patch I added one line to equate field_decl
number
with its die and that causes lookup_decl_die() at line#11374 to succeed.
But the die found is not in expected form and following check in
splice_child_die() causes abort.
5158 if (child->die_parent != parent
5159 && child->die_parent != get_AT_ref (parent,
DW_AT_specification))
5160 abort ();
--
Devang