]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-typeck.c (build_indirect_ref): Build INDIRECT_REF with correct type.
authorRichard Guenther <rguenth@gcc.gnu.org>
Thu, 2 Jun 2005 20:09:01 +0000 (20:09 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 2 Jun 2005 20:09:01 +0000 (20:09 +0000)
2005-06-02  Richard Guenther  <rguenth@gcc.gnu.org>

* c-typeck.c (build_indirect_ref): Build INDIRECT_REF
with correct type.

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

From-SVN: r100512

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

index 01fa616d522a8d4295ded12755da59f196c4eeec..530350c0fc045b90202408fe18a45d9899923649 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
index 00f701093ec7444a3991ffa2841c7e0a9a03b9bf..694eb696947964129322ca7b50a00d3828fe1c52 100644 (file)
@@ -1638,12 +1638,9 @@ build_indirect_ref (tree ptr, const char *errorstring)
       else
        {
          tree t = TREE_TYPE (type);
-         tree mvt = t;
          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)
            {
index 5d508e544ec1d8057b325318199dff856c39ee86..54647f001ef568411745fd96cee162139a7d97d7 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
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" } */
+}