This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Emit Fortran PARAMETERs as DW_TAG_constant into debuginfo


On Sat, Aug 30, 2008 at 03:34:57PM +0200, Eric Botcazou wrote:
> > BTW, in the backport of the native_encode_initializer patch to 4.3 branch
> > Ada passed a type in DECL_INITIALIZER, the committed patch will avoid
> > it because of the inializer_constant_valid_p test I've added, but having
> > type in DECL_INITIALIZER seems terribly broken to me and surprises me
> > other code doesn't break on it.
> 
> I presume you mean DECL_INITIAL?

Of course, sorry.  S/INITIALIZER/INITIAL/ in the mail.

> > In particular it was a PARM_DECL, which had
> > TREE_TYPE (parm) == DECL_INITIALIZER (parm)
> > && TREE_CODE (TREE_TYPE (parm)) == RECORD_TYPE.
> 
> Do you know how to reproduce that?

4.3 branch, powerpc64-linux --with-cpu=default32 (i.e. 32-bit ppc by default).
tree_add_const_value_attribute is called such a decl.
../prev-gcc/gnat1 -I- -I. -Iada -I../../gcc/ada -quiet -nostdinc -dumpbase osint.adb -O2 -Wall -fexceptions -fstack-protector -g -gnatpg -gnata -msecure-plt -gnatO ada/osint.o ../../gcc/ada/osint.adb --param ssp-buffer-size=4
#1  0x1075eb04 in tree_add_const_value_attribute (var_die=0xf6c35180, decl=0xf7b7bba0) at ../../gcc/dwarf2out.c:11326
#2  0x1075def4 in add_location_or_const_value_attribute (die=0xf6c35180, decl=0xf7b7bba0, attr=DW_AT_location) at ../../gcc/dwarf2out.c:11157
#3  0x1076199c in gen_formal_parameter_die (node=0xf7b7bba0, context_die=0xf6c35120) at ../../gcc/dwarf2out.c:12591
#4  0x10765e80 in gen_decl_die (decl=0xf7b7bba0, context_die=0xf6c35120) at ../../gcc/dwarf2out.c:14610
#5  0x10762850 in gen_subprogram_die (decl=0xf7b7c700, context_die=0xf7ffdd20) at ../../gcc/dwarf2out.c:13055
#6  0x10765b78 in gen_decl_die (decl=0xf7b7c700, context_die=0xf7ffdd20) at ../../gcc/dwarf2out.c:14526
#7  0x10766630 in dwarf2out_decl (decl=0xf7b7c700) at ../../gcc/dwarf2out.c:14864
decl is:
 <parm_decl 0xf7b7bba0 search_path
    type <record_type 0xf7b79cb0 system__os_lib__string_access readonly sizes-gimplified asm_written type_0 DI
        size <integer_cst 0xf7ffd720 constant invariant 64>
        unit size <integer_cst 0xf7ffd750 constant invariant 8>
        align 64 symtab -152575712 alias set -1 canonical type 0xf7b79d20
        fields <field_decl 0xf7b6a150 P_ARRAY type <pointer_type 0xf7b6a4d0>
            unsigned nonaddressable SI file ../../gcc/ada/osint.ads line 45 col 4
            size <integer_cst 0xf7ffd570 constant invariant 32>
            unit size <integer_cst 0xf7ffd1e0 constant invariant 4>
            align 32 offset_align 128
            offset <integer_cst 0xf7ffdae0 constant invariant 0>
            bit offset <integer_cst 0xf7ffdb10 constant invariant 0> context <record_type 0xf7b6a070 string___XUP> chain <field_decl 0xf7b6a1c0 P_BOUNDS>>
        unconstrained array <unconstrained_array_type 0xf7b6a0e0 string type <record_type 0xf7b6a070 string___XUP>
            sizes-gimplified visited BLK
            align 8 symtab 0 alias set -1 canonical type 0xf7b6a0e0
            pointer_to_this <record_type 0xf7b6a070 string___XUP> reference_to_this <record_type 0xf7b6a070 string___XUP>>
        pointer_to_this <pointer_type 0xf74f7770>>
    readonly used DI file ../../gcc/ada/osint.ads line 252 col 7 size <integer_cst 0xf7ffd720 64> unit size <integer_cst 0xf7ffd750 8>
    align 64 context <function_decl 0xf7b7c700 osint__get_next_dir_in_path_init> initial <record_type 0xf7b79cb0 system__os_lib__string_access> abstract_origin <parm_decl 0xf7b7bba0 search_path>
    (concatn/v:DI [
        (reg:SI 125 [ search_path ])
        (reg:SI 9 9 [orig:126 search_path+4 ] [126])
    ]) arg-type <record_type 0xf7b79cb0 system__os_lib__string_access>
    incoming-rtl (reg:SI 3 3)>

which has TREE_TYPE (decl) == DECL_INITIAL (decl).

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]