This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Simplifying TARGET_EXPR
- From: Jason Merrill <jason at redhat dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc at gcc dot gnu dot org,Jason Merrill <jason at redhat dot com>
- Date: Sat, 20 Jul 2002 17:09:42 +0100
- Subject: Re: [tree-ssa] Simplifying TARGET_EXPR
I'm interested in what y'all think about the second issue; it's something
I've run into previously when thinking about expanding NEW_EXPR.
One problem with (b) is that using it requires the frontend to know about
passing by invisible reference. However, in the cases where we pass by
invisible reference because TREE_ADDRESSABLE is set on the type, it's
already controlled by the frontend, so that doesn't seem like a big issue.
For cases where we would pass by invisiref for other reasons, doing a
bitwise copy is just inefficient, and we could leave it up to the optimizer
to fix that up.
--- Begin Message ---
- From: Jason Merrill <jason at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 16 Jul 2002 11:02:01 +0100
- Subject: [tree-ssa] Simplifying TARGET_EXPR
[snip]
2) Passing a TARGET_EXPR to a call means initializing the temporary on the
stack and passing its address to the call. There's no way to express
this in a simplified form; if we replace the TARGET_EXPR with the
variable it initializes, expand_call will make a bitwise copy, which is
wrong. I can think of two solutions to this:
a) Change expand_call to not copy variables with DECL_ARTIFICIAL set.
b) Pass an ADDR_EXPR of the variable instead, and change expand_call
to handle that case.
My preference is for (b), as (a) might have unintended consequences.
Thoughts?
Jason
--- End Message ---