Commit 31b52b5a by Richard Guenther Committed by Richard Biener

re PR c/33726 (Type checking error with address-of and volatile and arrays)

2007-10-11  Richard Guenther  <rguenther@suse.de>

	PR c/33726
	* c-typeck.c (build_array_ref): Do not strip qualifiers from
	the array element type.

	* gcc.dg/pr33726.c: New testcase.

From-SVN: r129227
parent 50f0f366
2007-10-11 Richard Guenther <rguenther@suse.de>
PR c/33726
* c-typeck.c (build_array_ref): Do not strip qualifiers from
the array element type.
2007-10-11 Eric Botcazou <ebotcazou@libertysurf.fr> 2007-10-11 Eric Botcazou <ebotcazou@libertysurf.fr>
PR rtl-optimization/33638 PR rtl-optimization/33638
...@@ -2113,8 +2113,6 @@ build_array_ref (tree array, tree index) ...@@ -2113,8 +2113,6 @@ build_array_ref (tree array, tree index)
} }
type = TREE_TYPE (TREE_TYPE (array)); type = TREE_TYPE (TREE_TYPE (array));
if (TREE_CODE (type) != ARRAY_TYPE)
type = TYPE_MAIN_VARIANT (type);
rval = build4 (ARRAY_REF, type, array, index, NULL_TREE, NULL_TREE); rval = build4 (ARRAY_REF, type, array, index, NULL_TREE, NULL_TREE);
/* Array ref is const/volatile if the array elements are /* Array ref is const/volatile if the array elements are
or if the array is. */ or if the array is. */
......
2007-10-11 Richard Guenther <rguenther@suse.de>
PR c/33726
* gcc.dg/pr33726.c: New testcase.
2007-10-11 Uros Bizjak <ubizjak@gmail.com> 2007-10-11 Uros Bizjak <ubizjak@gmail.com>
PR fortran/33500 PR fortran/33500
/* { dg-do compile } */
/* We used to ICE here with type-checking enabled. */
typedef unsigned int U032;
typedef volatile struct X {
U032 Monochrome[1];
struct {
U032 WidthHeight;
} UnclippedRectangle[1];
} RivaBitmap;
void writel(void *);
void rivafb_fillrect(RivaBitmap *bm)
{
writel((void *)&bm->UnclippedRectangle[0].WidthHeight);
}
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