dwarf2out.c fix
Jeffrey A Law
law@cygnus.com
Thu Dec 16 01:58:00 GMT 1999
Another one that slipped through the cracks. Jason approved this a while ago.
I've installed it.
------- Forwarded Message
Sender: gcc-bugs-owner@gcc.gnu.org
From: Zack Weinberg <zack@bitmover.com>
To: egcs-bugs@egcs.cygnus.com
Date: Sun, 25 Jul 1999 11:10:48 -0700
Subject: bootstrap ICE with --enable-checking in dwarf2out.c, current cvs
stage1/xgcc -Bstage1/ -c -DIN_GCC -W -Wall -O2 -ggdb -pipe
-DHAVE_CONFIG_H -I. -I../../../src/egcs/gcc
-I../../../src/egcs/gcc/config
-I../../../src/egcs/gcc/../include ../../../src/egcs/gcc/bitmap.c
../../../src/egcs/gcc/bitmap.c: In function `bitmap_clear':
../../../src/egcs/gcc/bitmap.c:643: Internal compiler error in
`decl_ultimate_origin', at dwarf2out.c:3630
We're blowing up on this:
<function_decl 0x84512c4 bitmap_clear
type <function_type 0x8451258
type <void_type 0x82d0b04 void allocated from permanent_obstack
asm_written permanent VOID
size <integer_cst 0x82d0ad4 constant permanent 0>
align 8 symtab 0 alias set 10
pointer_to_this <pointer_type 0x82d0be0>>
allocated from permanent_obstack
permanent DI
size <integer_cst 0x82ca990 constant permanent 64>
align 32 symtab 0 alias set 0
arg-types <tree_list 0x8451200 allocated from permanent_obstack
permanent value <pointer_type 0x8450a94 bitmap>
chain <tree_list 0x8451214 allocated from permanent_obstack
permanent value <void_type 0x82d0b04 void>>>
pointer_to_this <pointer_type 0x84705e0>>
allocated from permanent_obstack
asm_written used permanent public static QI
file ../../../src/egcs/gcc/bitmap.c line 220
*** abstract_origin <function_decl 0x84512c4 bitmap_clear>
arguments <parm_decl 0x8467480 head
type <pointer_type 0x8450a94 bitmap
type <record_type 0x83dc4c4 bitmap_head_def>
allocated from permanent_obstack
unsigned permanent SI
size <integer_cst 0x82caa50 constant permanent 32>
align 32 symtab 138165528 alias set 94>
allocated from function maybepermanent obstack
readonly unsigned used common SI
file ../../../src/egcs/gcc/bitmap.c line 220
size <integer_cst 0x82caa50 32>
align 32 context <function_decl 0x84512c4 bitmap_clear>
abstract_origin <parm_decl 0x8467480 head>
result <error_mark 0x82cf770> initial <pointer_type 0x8450a94 bitmap>
(reg/v:SI 3 %ebx)
incoming-rtl (mem/f:SI (reg:SI 16 %argp) 94)>
result <result_decl 0x8461e08 type <void_type 0x82d0b04 void>
allocated from permanent_obstack
permanent VOID file ../../../src/egcs/gcc/bitmap.c line 220
size <integer_cst 0x82d0ad4 0>
align 8 context <function_decl 0x84512c4 bitmap_clear>>
initial <block 0x846f708>
(mem/f:QI (symbol_ref:SI ("bitmap_clear")) 0)
saved-insns 0x846f770 chain <var_decl 0x845101c bitmap_zero>>
Note the abstract_origin, which points back to the same decl. Over in
c-decl.c we have this comment (in poplevel, where we are outputting
nested inline functions):
/* If this decl was copied from a file-scope decl
on account of a block-scope extern decl,
propagate TREE_ADDRESSABLE to the file-scope decl.
DECL_ABSTRACT_ORIGIN can be set to itself if warn_return_type is
true, since then the decl goes through save_for_inline_copying. */
The beginning of save_for_inline_copying would seem to confirm this:
/* The fndecl node acts as its own progenitor, so mark it as such. */
DECL_ABSTRACT_ORIGIN (fndecl) = fndecl;
I conclude that the definition of DECL_FROM_INLINE in tree.h is
wrong. Applying the appended patch allows a successful bootstrap. I
am still running the testsuite.
zw
Index: tree.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/tree.h,v
retrieving revision 1.71
diff -u -r1.71 tree.h
- --- tree.h 1999/05/02 17:43:32 1.71
+++ tree.h 1999/07/25 17:25:39
@@ -1131,8 +1131,11 @@
/* Nonzero for any sort of ..._DECL node means this decl node represents
an inline instance of some original (abstract) decl from an inline function
;
- - suppress any warnings about shadowing some other variable. */
- -#define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != (tree) 0)
+ suppress any warnings about shadowing some other variable.
+ FUNCTION_DECL nodes can also have their abstract origin set to themselves
+ (see save_for_inline_copying). */
+#define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != (tree) 0 \
+ && DECL_ABSTRACT_ORIGIN (NODE) != (NODE))
/* Nonzero if a _DECL means that the name of this decl should be ignored
for symbolic debug purposes. */
------- End of Forwarded Message
More information about the Gcc-patches
mailing list