public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ulrich Weigand <weigand@immd1.informatik.uni-erlangen.de>
To: rth@redhat.com (Richard Henderson)
Cc: weigand@immd1.informatik.uni-erlangen.de (Ulrich Weigand),
	gcc@gcc.gnu.org, uweigand@de.ibm.com
Subject: Re: RFA: Ada variable-sized objects, bit_size_type == TImode, and divti3
Date: Fri, 21 Mar 2003 20:25:00 -0000	[thread overview]
Message-ID: <200303211944.UAA16040@faui11.informatik.uni-erlangen.de> (raw)
In-Reply-To: <20030321071015.GA7800@redhat.com> from "Richard Henderson" at Mar 20, 2003 11:10:15 PM

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@informatik.uni-erlangen.de

  parent reply	other threads:[~2003-03-21 19:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-20 22:35 Ulrich Weigand
2003-03-20 23:44 ` Richard Henderson
2003-03-21  0:25   ` Neil Booth
2003-03-21  1:58   ` Ulrich Weigand
2003-03-21  7:46     ` Richard Henderson
2003-03-21 16:27       ` Ulrich Weigand
2003-03-21 20:25       ` Ulrich Weigand [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-04-02 15:43 Ulrich Weigand
2003-04-02 15:36 Ulrich Weigand
2003-04-02 15:36 Richard Kenner
2003-04-01 22:53 Richard Kenner
2003-04-01 19:26 Ulrich Weigand
2003-03-31 20:16 Richard Kenner
2003-03-24 11:08 Richard Kenner
2003-03-21  2:09 Ulrich Weigand
2003-03-20 21:55 Ulrich Weigand
2003-03-20 22:31 ` Richard Henderson
2003-03-20 23:18 ` Geert Bosch
2003-03-21  0:00 ` Janis Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200303211944.UAA16040@faui11.informatik.uni-erlangen.de \
    --to=weigand@immd1.informatik.uni-erlangen.de \
    --cc=gcc@gcc.gnu.org \
    --cc=rth@redhat.com \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).