Re: [RFA][2/5] New port: Cell BE SPU (valops.c fix)

Ulrich Weigand
2006-11-23T13:57:31Z

Daniel Jacobowitz wrote:

> I think that's precisely it. I'm worried that this will break some
> other uses of VALUE_TO_REGISTER, though - how do we keep track at
> this point in the code of "the whole struct is in the register"
> or "this field is in the register"? Right now, there's limited
> flexibility on that, but Jim's been working on improved DW_OP_piece
> support which would let us write to structure pieces.

Hmm, it looks like the enclosing type information is simply lost
currently. Those values come from value_subscripted_rvalue
(which appears to return an lvalue despite its name?), which
simply forgets about the base array type, and only updates
value_offset.

What value_assign would need is the information: I want to update
an object of type "int", which resides at offset 12 within an
object of type "array of four ints" which resides in register 42.
Then, we could call REGISTER_TO_VALUE on the enclosing type,
and do the read-update-write cycle.

However, we don't have the enclosing type in the data structure
at all, which makes it difficult. I'm wondering whether we can
employ the value_enclosing_type (and related) fields for this
purpose, but I'm not completely sure how that would interact
with the C++ use of those.

Bye,
Ulrich

--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com