This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Restrict implementation considered harmful


On Fri, Nov 21, 2008 at 08:31:18AM -0500, Diego Novillo wrote:
> On Fri, Nov 21, 2008 at 06:21, Richard Guenther <rguenther@suse.de> 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.

At least the second testcase in the PR you opened would be easily fixed if
we did the same as internal_get_tmp_var does for user VAR_DECLs of restrict
pointers from their initializers.  Guess something similar would need
to be done during inlining for restrict qualified arguments.

For the first testcase, I'm not sure how the compiler is supposed to find
out what other pointer is a restricted pointer based on, when it doesn't
have an initializer.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]