Commit b09869ff by Joseph Myers Committed by Joseph Myers

re PR middle-end/33272 (Compiler does not take advantage of restrict)

	PR middle-end/33272
	* c-decl.c (grokdeclarator): Apply qualifiers to type of parameter
	decayed from array.

testsuite:
	* gcc.dg/c99-arraydecl-3.c: New test.

From-SVN: r128018
parent 15dc95cb
2007-09-02 Joseph Myers <joseph@codesourcery.com>
PR middle-end/33272
* c-decl.c (grokdeclarator): Apply qualifiers to type of parameter
decayed from array.
2007-09-01 Kazu Hirata <kazu@codesourcery.com>
* config/arm/arm.c, config/rs6000/ppu_intrinsics.h,
......
......@@ -4719,6 +4719,8 @@ grokdeclarator (const struct c_declarator *declarator,
type = c_build_qualified_type (type, type_quals);
type = build_pointer_type (type);
type_quals = array_ptr_quals;
if (type_quals)
type = c_build_qualified_type (type, type_quals);
/* We don't yet implement attributes in this context. */
if (array_ptr_attrs != NULL_TREE)
......
2007-09-02 Joseph Myers <joseph@codesourcery.com>
PR middle-end/33272
* gcc.dg/c99-arraydecl-3.c: New test.
2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
PR c++/32597
/* Test for C99 forms of array declarator. Test restrict qualifiers
properly applied to type of parameter. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
void
f0 (int a[restrict])
{
int **b = &a; /* { dg-error "discards qualifiers" } */
int *restrict *c = &a;
}
void
f1 (a)
int a[restrict];
{
int **b = &a; /* { dg-error "discards qualifiers" } */
int *restrict *c = &a;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment