diff options
| author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-11 08:11:18 +0000 |
|---|---|---|
| committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-11 08:11:18 +0000 |
| commit | e2ae9c1145f7724b9c6b2d2b474644d61c108d6c (patch) | |
| tree | 1ad830132c4e994fd801417643c425df98ea1803 | |
| parent | 17e1318c3d1f5f078ce22f6a7e7928d1ec2d635c (diff) | |
| download | ppe42-gcc-e2ae9c1145f7724b9c6b2d2b474644d61c108d6c.tar.gz ppe42-gcc-e2ae9c1145f7724b9c6b2d2b474644d61c108d6c.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129227 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/c-typeck.c | 2 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/pr33726.c | 17 |
4 files changed, 28 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f2568d6c5bf..0d1c15a827d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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> PR rtl-optimization/33638 diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 0bad8e5a45c..3d80ce2f275 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -2113,8 +2113,6 @@ build_array_ref (tree array, tree index) } 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); /* Array ref is const/volatile if the array elements are or if the array is. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cb4f5d986f2..49f071bc6ae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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> PR fortran/33500 diff --git a/gcc/testsuite/gcc.dg/pr33726.c b/gcc/testsuite/gcc.dg/pr33726.c new file mode 100644 index 00000000000..e87cbc56573 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr33726.c @@ -0,0 +1,17 @@ +/* { 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); +} + |

