On Fri, 21 Nov 2008, Diego Novillo wrote: > On Fri, Nov 21, 2008 at 06:21, Richard Guenther <[EMAIL PROTECTED]> wrote: > > > I think the only reasonable thing to do is to rip out the broken > > restrict pointer handling completely. > > > > Any better ideas? > > I will assume that this program is valid. I am not familiar enough > with the restrict definition, but ISTM that if __restrict implies a > contract not to make the pointers conflict, then this program is > obviously violating it.
Pointers based on the same restrict base do conflict according to the standard. > Having said that, relying on restrict based purely on the DECLs does > seem like a bad idea. What if we encoded restrict in the SSA names > themselves? PTA could flip a bit specifying whether get_alias_set can > rely on restrict or not. Though that seems a bit kludgy. My idea was to instead compute the based-on property during PTA and treat restrict as additional source of points-to information (that is, if we identified two different restrict pointers as bases for two pointers then accesses through them cannot alias). The idea of indirecting this query through assigning an alias set seems to be a fundamental mistake and makes the query much more fragile. See PR38212 for a testcase that is miscompiled at -O2. Richard.