This is the mail archive of the
mailing list for the GCC project.
Re: More on gimplify:create_tmp_var
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: rth at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 6 Jun 04 13:47:44 EDT
- Subject: Re: More on gimplify:create_tmp_var
No, I don't. Why? Because get_inner_reference is not type safe.
I don't follow. The issue isn't type safety.
For access efficiency, we want to nest ARRAY_REF, COMPONENT_REF, and
the other references. These are all handled in get_inner_reference as
a single access, by merging all the offsets. So *anything* that it can
handle should be gone "inside" by this routine.
I think you should be generating <INDIRECT_REF <NOP_EXPR <VAR>>>
instead of using VIEW_CONVERT_EXPR after the fact.
That seems *far* worse. Because then the INDIRECT_REF will *have* to
make a temporary and that temporary is often variable-sized. It seems
we'd have lots of copies.
Except that as a short-term hack you'll have to use a non-aliasing
type variant of the original type for the INDIRECT_REF.
I don't follow.
The point is that a very deep nest of COMPONENT_REF, VIEW_CONVERT_EXPR,
and ARRAY_REF is quite common in Ada. We don't need to make a temporary
(or want to) of any of the aggregates in between. We also don't want to
take their address since they are non-addressable.