aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-gimplify.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-04-11 07:32:52 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-04-11 07:32:52 +0000
commitfa78c0c18bd008b04e41e1679461a0d837e72087 (patch)
treefa5ee4a7d08a196308c8aeb874547135b7cffd71 /gcc/c-gimplify.c
parent4d7221309b3d13258a824b27533563cd012a1b6f (diff)
downloadgcc-fa78c0c18bd008b04e41e1679461a0d837e72087.zip
gcc-fa78c0c18bd008b04e41e1679461a0d837e72087.tar.gz
gcc-fa78c0c18bd008b04e41e1679461a0d837e72087.tar.bz2
re PR c/39712 (type mismatch in address expression)
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
Diffstat (limited to 'gcc/c-gimplify.c')
-rw-r--r--gcc/c-gimplify.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c
index cf06974..a361e90 100644
--- a/gcc/c-gimplify.c
+++ b/gcc/c-gimplify.c
@@ -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)