Bug 29237 - Failure to appropriately qualify C99 pointer decayed from array parameter
Summary: Failure to appropriately qualify C99 pointer decayed from array parameter
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid, missed-optimization
Depends on:
Blocks: 16989 33272
  Show dependency treegraph
 
Reported: 2006-09-26 14:06 UTC by Neil Booth
Modified: 2007-11-05 00:08 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-09-26 14:21:23


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Booth 2006-09-26 14:06:04 UTC
The following code should raise a diagnostic with -std=c99 -pedantic-errors

int **p;

void foo (int b[restrict 2])
{
  p = &b;
}
Comment 1 Andrew Pinski 2006-09-26 14:21:23 UTC
Confirmed.
Comment 2 Andrew Pinski 2006-09-26 17:45:34 UTC
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.
Comment 3 Andrew Pinski 2007-11-05 00:08:21 UTC
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

Comment 4 Andrew Pinski 2007-11-05 00:08:25 UTC
Fixed.