[PATCH] Handle &__restrict parameters in tree-ssa-structalias.c like DECL_BY_REFERENCE parameters

Jason Merrill jason@redhat.com
Sat Sep 24 21:15:00 GMT 2011


On 09/24/2011 07:26 AM, Richard Guenther wrote:
> I don't see why
>
>    f4 (s, s)
>
> would be invalid.  But you would miscompile it.

>> +int
>> +f4 (S&x, S&y)
>> +{
>> +  x.p[0] = 4;
>> +  y.p[0] = 0; // { dg-final { scan-tree-dump-times "return 4" 0 "optimized" } }
>> +  return x.p[0];
>> +}

It looks to me like the testcase is testing that we *don't* optimize f4, 
which I think is the correct result.

> +// We might handle this some day
> +// { dg-final { scan-tree-dump-times "return 5" 0 "optimized" } }

But we could optimize f5, so I don't think we want to test for not 
optimizing.  Better would be to test for the optimization, but mark it 
as xfail.

Jason



More information about the Gcc-patches mailing list