[C++/66270] another may_alias crash
Nathan Sidwell
nathan@acm.org
Wed May 27 12:42:00 GMT 2015
On 05/26/15 15:00, Nathan Sidwell wrote:
> On 05/25/15 21:18, Jason Merrill wrote:
>> Hmm, are you seeing a case where TYPE_CANONICAL (to_type) has the may_alias
>> attribute?
>
> Yes. This occurs when the newly created TRCAA pointer is to a self-canonical
> type. The
> else if (TYPE_CANONICAL (to_type) != to_type)
> is false, so the newly created pointer is self-canonical too (and has TRCAA).
>
> If the canonical type should not have TRCAA we need to change the if condition to:
> else if (TYPE_CANONICAL (to_type) != to_type || could_alias_all)
>
> where COULD_ALIAS_ALL is the incoming CAN_ALIAS_ALL value. Does that make sense?
>
> Making that change does stop the ICE I was seeing, but I've not done a full
> test yet.
Here's a patch implementing that change, When build_pointer_type_for_mode is
passed true for CAN_ALIAS_ALL, we force creating a canonical type, continuing to
pass false for that pointer's creation.
booted & tested on x86-64-linux, ok?
nathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 66270-2.patch
Type: text/x-patch
Size: 2018 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150527/b92e99e1/attachment.bin>
More information about the Gcc-patches
mailing list