This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Hack to make restrict more useful
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Mark Mitchell" <mark at codesourcery dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>, "Daniel Berlin" <dberlin at dberlin dot org>
- Date: Sat, 1 Sep 2007 10:52:32 +0200
- Subject: Re: RFC: Hack to make restrict more useful
- References: <46D89B03.3070301@codesourcery.com>
On 9/1/07, Mark Mitchell <mark@codesourcery.com> wrote:
> This bug:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33272
>
> is about a situation in which -fargument-noalias works better than
> putting "restrict" on all pointer arguments to a function, even though
> that should be logically equivalent. Using "restrict" for all arguments
> to a function is probably one of the most common cases of "restrict";
> that's what you want for things like the test case I posted, and for
> other Fortran-ish code.
>
> I have a prototype hack which changes checks of flag_argument_noalias !=
> 0 to also check for the presence of "restrict" on all pointer arguments.
> This fixes the test case, modulo a C front-end bug which Joseph has
> volunteered to fix.
>
> To make that a real patch, here's what I plan to do:
>
> (1) Add a flag to "struct function" to say "all pointer arguments are
> restrict".
>
> (2) Lazily set it, when something wants to check it.
>
> (3) Change checks of flag_argument_noalias to call a function
> argument_noalias() which will return an "int" with the same meaning as
> flag_argument_noalias.
>
> Does that plan sound OK to folks?
AFAIK Danny had been "fixing restrict" on his working agenda lately. No
idea what the status on that is, though.
Richard.