]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/39712 (type mismatch in address expression)
authorRichard Guenther <rguenther@suse.de>
Sat, 11 Apr 2009 07:32:52 +0000 (07:32 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 11 Apr 2009 07:32:52 +0000 (07:32 +0000)
2009-04-11  Richard Guenther  <rguenther@suse.de>

PR c/39712
* c-gimplify.c (c_gimplify_expr): Adjust check for mismatched
address expressions.

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

From-SVN: r145950

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

index 228e54163c4283be7678e070c30af5fb45a84d84..59c28c90dad53918e14043be308444142bc7c0e1 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-11  Richard Guenther  <rguenther@suse.de>
+
+       PR c/39712
+       * c-gimplify.c (c_gimplify_expr): Adjust check for mismatched
+       address expressions.
+
 2009-04-11  Dave Korn  <dave.korn.cygwin@gmail.com>
 
        * config/i386/cygwin-stdint.h (INT_LEAST32_TYPE):  Update to
index cf06974c53ab50b3d640f622d1f1b0232a013a64..a361e904b933f2176a42295b74f5d43ddacc872e 100644 (file)
@@ -201,7 +201,8 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
      ADDR_EXPR instead and wrap a conversion around it.  */
   if (code == ADDR_EXPR
       && TREE_CODE (TREE_TYPE (TREE_OPERAND (*expr_p, 0))) == ARRAY_TYPE
-      && TREE_CODE (TREE_TYPE (TREE_TYPE (*expr_p))) != ARRAY_TYPE)
+      && !lang_hooks.types_compatible_p (TREE_TYPE (TREE_TYPE (*expr_p)),
+                                        TREE_TYPE (TREE_OPERAND (*expr_p, 0))))
     {
       tree type = TREE_TYPE (*expr_p);
       TREE_TYPE (*expr_p)
index da40b35470f16e8065912877731c0bd0d194b1ac..f74dad28e4b143b800980e283f2ee06ea00c7453 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-10  Richard Guenther  <rguenther@suse.de>
+
+       PR c/39712
+       * gcc.dg/pr39712.c: New testcase.
+
 2009-04-10  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR c++/28301
diff --git a/gcc/testsuite/gcc.dg/pr39712.c b/gcc/testsuite/gcc.dg/pr39712.c
new file mode 100644 (file)
index 0000000..9846e33
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+int is_table[2][16];
+int is_table_lsf[2][2][16];
+void compute_stereo()
+{
+  int (*is_tab)[16];
+  is_tab = is_table;
+}