This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: MEM/u trouble
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Subject: Re: MEM/u trouble
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 13 Mar 2001 10:30:01 -0500
- Cc: gcc-patches at gcc dot gnu dot org
- References: <10103131425.AA22252@vlsi1.ultra.nyu.edu>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Tue, Mar 13, 2001 at 09:25:21AM -0500, Richard Kenner wrote:
> Can I access a (mem/u (addressof ())) this way at least?
>
> No since it's usually allocated via a stack slot.
I thought that (mem (addressof ())) means a stack slot has not been assigned
for it yet and it is unclear whether it is actually needed, so IMHO clearing
the /u flag should just kill it for all mems for that addressof and nothing
else.
>
> Or do we have to force initialization of the slot at a temporary and
> then copying it to the const location (that would pessimize the code)?
>
> I don't understand the original problem. How did /u get set incorrectly in
> the first place?
In
foo(const K x) : h(x) {}
x is a const variable (so its VAR_DECLs DECL_RTL got /u) and is addressable
(so it was put_var_into_stack() and got assigned a
(addressof:SI (reg/v/u:SI 63) 62 0x401d5888)).
x is being initialized from a temporary variable (surrounded by TARGET_EXPR)
and expand_expr in the TARGET_EXPR case decides it can optimize things by
simply initializing the temporary variable at the location of x (and thus
avoid copying). But the temporary variable is not const whyle x is.
Jakub