This is the mail archive of the gcc@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]

Ada and TYPE_SIZE of ARRAY_TYPEs


Ada seems to set TYPE_SIZE of an ARRAY_TYPE to integer_zero_node,
which does not follow (tree.def):

/* Each node that represents a data type has a component TYPE_SIZE
   containing a tree that is an expression for the size in bits.

also it makes querying the element size difficult if you have an
array of an array.  From c43207b.adb we f.i. get

(gdb) call debug_tree(type)
 <array_type 0x401e2000 c43207b__case_b__case_b2__T31b
    type <array_type 0x401dcf74
        type <integer_type 0x401d4398 integer type <integer_type 
0x4019c284 integer>
            sizes-gimplified public SI
            size <integer_cst 0x4018d3f0 constant invariant 32>
            unit size <integer_cst 0x4018d180 constant invariant 4>
            user align 32 symtab 0 alias set 19 precision 32 min 
<integer_cst 0x4018d3a8 -2147483648> max <integer_cst 0x4018d3c0 
2147483647> RM size <integer_cst 0x4018d3f0 32>
            pointer_to_this <pointer_type 0x401d4450>>
        sizes-gimplified nonaliased-component type_1 BLK
        size <integer_cst 0x4018d7c8 constant invariant 0>
        unit size <integer_cst 0x4018d198 constant invariant 0>
        user align 32 symtab 0 alias set 6
        domain <integer_type 0x401dcf18 type <integer_type 0x4019c000 long 
int>
            sizes-gimplified SI size <integer_cst 0x4018d3f0 32> unit size 
<integer_cst 0x4018d180 4>
            align 32 symtab 0 alias set -1 precision 32 min <integer_cst 
0x401c25e8 6> max <integer_cst 0x401c25d0 5> index type <integer_type 
0x401dcebc c43207b__case_b__case_b2__T30b___XDLU_6__5>>
        pointer_to_this <pointer_type 0x401e205c>>
    sizes-gimplified nonaliased-component BLK size <integer_cst 0x4018d7c8 
0> unit size <integer_cst 0x4018d198 0>
    user align 32 symtab 0 alias set 7
    domain <integer_type 0x401dce60
        type <integer_type 0x4019c000 long int sizes-gimplified public 
visited sizetype SI size <integer_cst 0x4018d3f0 32> unit size 
<integer_cst 0x4018d180 4>
            align 32 symtab 0 alias set -1 precision 32 min <integer_cst 
0x4018d708 -2147483648> max <integer_cst 0x4018d720 2147483647>>
        sizes-gimplified SI size <integer_cst 0x4018d3f0 32> unit size 
<integer_cst 0x4018d180 4>
        align 32 symtab 0 alias set -1 precision 32 min <var_decl 
0x401ed420 D.663> max <var_decl 0x401ed4d0 D.665>
        index type <integer_type 0x401dce04 
c43207b__case_b__case_b2__T29b___XD type <integer_type 0x4019c284 integer>
            sizes-gimplified SI size <integer_cst 0x4018d3f0 32> unit size 
<integer_cst 0x4018d180 4>
            user align 32 symtab 0 alias set -1 precision 32 min <var_decl 
0x401985d8 R27b> max <var_decl 0x40198630 R28b> RM size <integer_cst 
0x4018d3f0 32>>>
    pointer_to_this <pointer_type 0x401e2228>>


which could have TYPE_SIZE of both subtypes set correctly.  (Why does
ada chose integer_zero_node here and not NULL_TREE, btw.?)

Any idea on how to fix ada?  Or does it not need fixing and I am
just confused about the validity of TYPE_SIZE here?

Thanks,
Richard.


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