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: [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 ---
[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 ---

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