OSDN Git Service

2005-06-02 Richard Guenther <rguenth@gcc.gnu.org>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 2 Jun 2005 20:09:01 +0000 (20:09 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 2 Jun 2005 20:09:01 +0000 (20:09 +0000)
* c-typeck.c (build_indirect_ref): Build INDIRECT_REF
with correct type.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100512 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/wtypequal.c [new file with mode: 0644]

index 01fa616..530350c 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-02  Richard Guenther  <rguenth@gcc.gnu.org>
+
+       * c-typeck.c (build_indirect_ref): Build INDIRECT_REF
+       with correct type.
+
 2005-06-02  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * config/s390/s390.c (s390_add_execute): Do not handle out-of-pool
 2005-06-02  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * config/s390/s390.c (s390_add_execute): Do not handle out-of-pool
index 00f7010..694eb69 100644 (file)
@@ -1638,12 +1638,9 @@ build_indirect_ref (tree ptr, const char *errorstring)
       else
        {
          tree t = TREE_TYPE (type);
       else
        {
          tree t = TREE_TYPE (type);
-         tree mvt = t;
          tree ref;
 
          tree ref;
 
-         if (TREE_CODE (mvt) != ARRAY_TYPE)
-           mvt = TYPE_MAIN_VARIANT (mvt);
-         ref = build1 (INDIRECT_REF, mvt, pointer);
+         ref = build1 (INDIRECT_REF, t, pointer);
 
          if (!COMPLETE_OR_VOID_TYPE_P (t) && TREE_CODE (t) != ARRAY_TYPE)
            {
 
          if (!COMPLETE_OR_VOID_TYPE_P (t) && TREE_CODE (t) != ARRAY_TYPE)
            {
index 5d508e5..54647f0 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-02  Richard Guenther  <rguenth@gcc.gnu.org>
+
+       * gcc.dg/wtypequal.c: New testcase.
+
 2005-06-02  Diego Novillo  <dnovillo@redhat.com>
 
        PR 21582
 2005-06-02  Diego Novillo  <dnovillo@redhat.com>
 
        PR 21582
diff --git a/gcc/testsuite/gcc.dg/wtypequal.c b/gcc/testsuite/gcc.dg/wtypequal.c
new file mode 100644 (file)
index 0000000..9a71899
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+int *__restrict *p;
+void f(void)
+{
+  __typeof(*p) *q = p; /* { dg-bogus "discards qualifiers" } */
+}