This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to implement `restrict' in C
- To: mark at markmitchell dot com
- Subject: Re: PATCH to implement `restrict' in C
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Thu, 15 Oct 1998 09:39:05 +0100
- CC: law at cygnus dot com, egcs-patches at cygnus dot com
- Organization: Computer Science Dept, Bristol University
- References: <9531.908385347@hurl.cygnus.com> <199810142329.QAA11079@smtp.earthlink.net>
Mark Mitchell wrote:
> In general, it's very straightforward to extend `restrict' to C++. The
> issue of member function declarations like:
>
> struct S {
> void f() restrict;
> };
>
> is tricky, though. If that `restrict' were `const' it would mean that
> `this' has type `S const*'. But, `S restrict*' is illegal; `restrict'
> may only refer to pointer (reference) types. So, using `restrict' in
> this context to mean `S* restrict' would be very un-orthogonal.
Yes, this is unfortunate, but is what I'd done in my previous
C++/restrictedness experience. It made shed loads of improvements
to the object code.
> On the other hand, it would be nice to have a way to indicate that
> `this' is `restrict'ed, and you can't do it at the definition point
> because you don't explicitly declare `this'. Although I have thought
> about this issue, I have not yet decided what to do. I think that the
> right thing is to see what EDG-based C++ compilers that support
> `restrict' do, and match it.
I agree. EDG support restricted references too and that's also
important.
I don't know their syntax for that or for member functions.
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
You can up the bandwidth, but you can't up the speed of light
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk