The following code should raise a diagnostic with -std=c99 -pedantic-errors int **p; void foo (int b[restrict 2]) { p = &b; }
Confirmed.
Note I marked this as a missed optimization also because we don't record b as restrict which means we don't get a new aliasing set.
Subject: Bug 29237 Author: pinskia Date: Mon Nov 5 00:08:04 2007 New Revision: 129888 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129888 Log: Index: ChangeLog =================================================================== --- ChangeLog (revision 129887) +++ ChangeLog (working copy) @@ -6447,6 +6447,7 @@ 2007-09-02 Joseph Myers <joseph@codesourcery.com> + PR c/29237 PR middle-end/33272 * c-decl.c (grokdeclarator): Apply qualifiers to type of parameter decayed from array. Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 129887) +++ testsuite/ChangeLog (working copy) @@ -3041,6 +3041,7 @@ 2007-09-02 Joseph Myers <joseph@codesourcery.com> + PR C/29237 PR middle-end/33272 * gcc.dg/c99-arraydecl-3.c: New test. Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog
Fixed.