https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120780

--- Comment #15 from Siddhesh Poyarekar <siddhesh at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #14)
> 
> So, __bdos returns something larger than that?  That would be weird.
> Or do the two calls result in different results?

It's basically comment 9; __bdos returns 0 because it thinks the negative
offset to access the parent struct using the child pointer is an invalid
access.  That will basically happen at runtime too, with the MAX(sz, offset) -
offset pattern we emit.

What we basically need is a way to identify the MEM_REF in such cases and use
the parent struct to get the size:

_1 = MEM[(struct container *)ifmsh_5 + -24B]

recognize that TREE_TYPE(_1) contains TREE_TYPE(ifmsh_5) and adjust for it.

Reply via email to