> 
> Sadly this doesn't appear to have fixed the issue.

I have now reproduced it on AIX. We die at:
          /* Sanity check user variables for flag changes.  */
          if (sect->named.decl != NULL
              && DECL_P (sect->named.decl)
              && decl != sect->named.decl)
            {
              if (decl != NULL && DECL_P (decl))
                error ("%+D causes a section type conflict with %D",
                       decl, sect->named.decl);
              else
                error ("section type conflict with %D", sect->named.decl);
              inform (DECL_SOURCE_LOCATION (sect->named.decl),
                      "%qD was declared here", sect->named.decl);
            }

here we have decl and its local alias:
(gdb) p debug_tree (sect->named.decl)
 <var_decl 70f7d060 _ZTCSt14basic_ifstreamIcSt11char_traitsIcEE0_Si
    type <array_type 70dd8840
        type <pointer_type 700f5840 __vtbl_ptr_type type <function_type 
700f57e0>
            unsigned SI
            size <integer_cst 70006498 constant 32>
            unit size <integer_cst 700064b0 constant 4>
            align 32 symtab 45 alias set 3 canonical type 700f5840
            pointer_to_this <pointer_type 700f5900>>
        BLK
        size <integer_cst 708002d0 constant 320>
        unit size <integer_cst 708000d8 constant 40>
        align 32 symtab 0 alias set 3 canonical type 70dd8840
        domain <integer_type 701a78a0 type <integer_type 7001d000 sizetype>
            type_6 SI size <integer_cst 70006498 32> unit size <integer_cst 
700064b0 4>
            align 32 symtab 0 alias set -1 canonical type 701a78a0 precision 32 
min <integer_cst 700064c8 0> max <integer_cst 701a5b88 9>>
        pointer_to_this <pointer_type 71272d80>>
    readonly addressable used public static tree_1 tree_5 tree_6 ignored weak 
in_system_header virtual decl_5 SI file 
/home/jh/trunk/c/powerpc-ibm-aix7.1.0.0/libstdc++-v3/include/fstream line 444 
col 11 size <integer_cst 708002d0 320> unit size <integer_cst 708000d8 40>
    user align 32 context <record_type 701eb000 basic_ifstream> initial 
<constructor 70f63680>
   
    (mem/u/c:SI (symbol_ref/i:SI 
("_ZTCSt14basic_ifstreamIcSt11char_traitsIcEE0_Si") [flags 0x82] <var_decl 
70f7d060 _ZTCSt14basic_ifstreamIcSt11char_traitsIcEE0_Si>) [3 
_ZTCSt14basic_ifstreamIcSt11char_traitsIcEE0_Si+0 S40 A32])>
$6 = 10
(gdb) p debug_tree (decl)
 <var_decl 714174e0 
_ZTCSt14basic_ifstreamIcSt11char_traitsIcEE0_Si.localalias.69
    type <array_type 70dd8840
        type <pointer_type 700f5840 __vtbl_ptr_type type <function_type 
700f57e0>
            unsigned SI
            size <integer_cst 70006498 constant 32>
            unit size <integer_cst 700064b0 constant 4>
            align 32 symtab 45 alias set 3 canonical type 700f5840
            pointer_to_this <pointer_type 700f5900>>
        BLK
        size <integer_cst 708002d0 constant 320>
        unit size <integer_cst 708000d8 constant 40>
        align 32 symtab 0 alias set 3 canonical type 70dd8840
        domain <integer_type 701a78a0 type <integer_type 7001d000 sizetype>
            type_6 SI size <integer_cst 70006498 32> unit size <integer_cst 
700064b0 4>
            align 32 symtab 0 alias set -1 canonical type 701a78a0 precision 32 
min <integer_cst 700064c8 0> max <integer_cst 701a5b88 9>>
        pointer_to_this <pointer_type 71272d80>>
    readonly addressable used static tree_1 tree_5 tree_6 ignored 
in_system_header decl_5 SI file 
/home/jh/trunk/c/powerpc-ibm-aix7.1.0.0/libstdc++-v3/include/fstream line 444 
col 11 size <integer_cst 708002d0 320> unit size <integer_cst 708000d8 40>
    user align 32 context <record_type 701eb000 basic_ifstream>
   >
$7 = 10

this seems correct - the alias definitely belongs to the section that its 
terget is placed into.
I am not however sure what the test is really checking.   It seems to insist on 
named sections
to consist only of one decl.

The error happens when we attempt to produce RTL for alias:
#0  _Z5errorPKcz (gmsgid=0x11775e44 <__gmpn_bases+42484> "%+D causes a section 
type conflict with %D") at ../../gcc/diagnostic.c:1048
#1  0x1088d0a0 in _Z11get_sectionPKcjP9tree_node (name=0x711de9d0 
"_ZTCSt14basic_ifstreamIcSt11char_traitsIcEE0_Si", flags=2097667, 
decl=0x714174e0) at ../../gcc/varasm.c:320
#2  0x1088d4d0 in _Z17get_named_sectionP9tree_nodePKci (decl=0x714174e0, 
name=0x711de9d0 "_ZTCSt14basic_ifstreamIcSt11char_traitsIcEE0_Si", reloc=0) at 
../../gcc/varasm.c:419
#3  0x1088f2e8 in _Z20get_variable_sectionP9tree_nodeb (decl=0x714174e0, 
prefer_noswitch_p=true) at ../../gcc/varasm.c:1112
#4  0x1088f594 in _ZL18get_block_for_declP9tree_node (decl=0x714174e0) at 
../../gcc/varasm.c:1161
#5  0x1088ff60 in _Z13make_decl_rtlP9tree_node (decl=0x714174e0) at 
../../gcc/varasm.c:1376

Perhaps get_vairable_section should look for alias target, since that is the
decl really deciding on the section? Richard?

Honza

Reply via email to