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]

Re: RFA: Ada variable-sized objects, bit_size_type == TImode, and divti3


Richard Henderson wrote:
> On Fri, Mar 21, 2003 at 02:15:36AM +0100, Ulrich Weigand wrote:
> > Well, but we don't need the size in bits when computing stack
> > alignment.
> 
> True.  Perhaps you can find out why we're doing this?

OK, what happens here is that Ada passes to expand_decl a tree
describing this dynamically sized variable which has this as
'size' (i.e. size in bits) expression:

 <mult_expr 0x100002966c0
    type <integer_type 0x100001b7870 bit_size_type sizetype TI>
    arg 0 <ceil_div_expr 0x10000296680 type <integer_type 0x100001b7870 bit_size_type>
        arg 0 <mult_expr 0x10000296140 type <integer_type 0x100001b7870 bit_size_type>
            arg 0 <nop_expr 0x10000293eb0 type <integer_type 0x100001b7870 bit_size_type>
                arg 0 <non_lvalue_expr 0x10000293e88 type <integer_type 0x100001b7798 long int>
                    arg 0 <max_expr 0x10000295d80 type <integer_type 0x100001b7798 long int>
                        arg 0 <nop_expr 0x10000293c08 type <integer_type 0x100001b7798 long int>
                            readonly arg 0 <var_decl 0x10000290438 R1b>>
                        arg 1 <integer_cst 0x100001b8240 constant 0>>>>
            arg 1 <integer_cst 0x100001b8400 constant 8>>
        arg 1 <integer_cst 0x100001b8040 constant 64>> 
    arg 1 <integer_cst 0x100001b8040 64>>

and this even more complex tree as 'unit size' (size in bytes):

 <mult_expr 0x10000296740
    type <integer_type 0x100001b7798 long int sizetype DI>
    arg 0 <ceil_div_expr 0x10000296700 type <integer_type 0x100001b7798 long int>
        arg 0 <nop_expr 0x10000298230 type <integer_type 0x100001b7798 long int>
            arg 0 <exact_div_expr 0x10000296440 type <integer_type 0x100001b7870 bit_size_type>
                arg 0 <mult_expr 0x10000296140 type <integer_type 0x100001b7870 bit_size_type>
                    arg 0 <nop_expr 0x10000293eb0 type <integer_type 0x100001b7870 bit_size_type>
                        arg 0 <non_lvalue_expr 0x10000293e88 type <integer_type 0x100001b7798 long int>
                            arg 0 <max_expr 0x10000295d80>>>
                    arg 1 <integer_cst 0x100001b8400 constant 8>> 
                arg 1 <integer_cst 0x100001b8400 8>>>
        arg 1 <integer_cst 0x100001b80c0 constant 8>> 
    arg 1 <integer_cst 0x100001b80c0 8>>

expand_decl then passes this tree to expand_expr in order to compute 
the size needed for the variable (which is then passed on to 
allocate_dynamic_stack_space).

expand_expr now goes through this tree and creates a whole bunch
of RTL expressing all that stuff, including conversions between
DImode and TImode and the various divisions and multiplications.
The resulting RTL is then so complex that it won't get optimized
away by the RTL optimizers.

It would appear that at some stage in the process this expression
could be simplified to avoid use of TImode operations, but I'm not
familiar enough with the front-end parts to decide where ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand at informatik dot uni-erlangen dot de


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