[PATCH] Fix another bad alias warning for ref-all pointers

Richard Guenther richard.guenther@gmail.com
Sun Aug 10 19:30:00 GMT 2008


On Sun, Aug 10, 2008 at 9:14 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Thu, Aug 7, 2008 at 2:57 AM, Richard Guenther <rguenther@suse.de> wrote:
>>
>> The tree-ssa-alias-warnings machinery had the same problem as the FE one.
>>
>> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to the
>> trunk and the 4.3 branch.
>>
>> Richard.
>>
>> 2008-08-07  Richard Guenther  <rguenther@suse.de>
>>
>>        PR middle-end/37042
>>        * tree-ssa-alias-warnings.c (nonstandard_alias_p): Ref-all
>>        pointers can access anything.
>>
>>        * gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c: New testcase.
>>
>> Index: gcc/tree-ssa-alias-warnings.c
>> ===================================================================
>> *** gcc/tree-ssa-alias-warnings.c       (revision 138797)
>> --- gcc/tree-ssa-alias-warnings.c       (working copy)
>> *************** nonstandard_alias_p (tree ptr, tree alia
>> *** 860,865 ****
>> --- 860,869 ----
>>    tree ptr_type = get_otype (ptr, true);
>>    tree alias_type = get_otype (alias, ptr_ptr);
>>
>> +   /* If this is a ref-all pointer the access is ok.  */
>> +   if (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (ptr)))
>> +     return false;
>> +
>>    /* XXX: for now, say it's OK if the alias escapes.
>>       Not sure this is needed in general, but otherwise GCC will not
>>       bootstrap.  */
>> Index: gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c
>
> This testcase fails on PPC64 Linux:
> /home/apinski/src/local/gcc/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c:8:
> warning: GCC vector returned by reference: non-standard ABI extension
> with no compatibility guarantee

Feel free to fix it appropriately.

Thanks,
Richard.



More information about the Gcc-patches mailing list