[aarch64-port-dev ] RFR: Fix SEGV with volatile field accesses
Andrew Haley
aph at redhat.com
Thu Feb 20 04:57:50 PST 2014
On 02/20/2014 10:38 AM, Andrew Dinn wrote:
> Hi Ed,
>
> On 20/02/14 10:19, Andrew Dinn wrote:
>> I think I have seen this problem before and I thought I came up with a
>> way of fixing it. . . .
>
> Ok, the case I was thinking of is one you can see above when we have a
> MachCallNode. It implements a method ret_addr_offset() that allows the
> location of the ret instruction to be computed relative to current
> offset. The default implementation needs to be explicitly overridden in
> the ad file if the ret does not appear at offset 0.
>
> I think it would be safer and clearer to implement a similar solution i.e.
>
> when a MachNode responds yes to mach->is_NullCheck() in
> Compile::fill_buffer (that's the routine you quoted from output.cpp)
> call mach->null_check_offset() to compute the offset to the null_check
> instruction and add that in.
>
> provide a default implementation on MachNode to return offset 0.
>
> add a redefinition of null_check_offset() for the relevant machine
> load nodes to the ad file (as is done for ret_addr_offset() q.v.).
>
> Whatever we do we need to change generic code. So, I would prefer this
> as an explicit way of marking what we are doing here. Your solution
> works but I feel it is is much easier to misunderstand.
>
> Andrew Haley, any thoughts on this?
Can't we imply nuke the patters that recognize instructions we can't
generate? Then C2 would have only patterns that take a volatile address
with no offset.
Andrew.
More information about the aarch64-port-dev
mailing list