diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 228e54163c4..59c28c90dad 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-04-11 Richard Guenther + + PR c/39712 + * c-gimplify.c (c_gimplify_expr): Adjust check for mismatched + address expressions. + 2009-04-11 Dave Korn * config/i386/cygwin-stdint.h (INT_LEAST32_TYPE): Update to diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c index cf06974c53a..a361e904b93 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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index da40b35470f..f74dad28e4b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-04-10 Richard Guenther + + PR c/39712 + * gcc.dg/pr39712.c: New testcase. + 2009-04-10 H.J. Lu PR c++/28301 diff --git a/gcc/testsuite/gcc.dg/pr39712.c b/gcc/testsuite/gcc.dg/pr39712.c new file mode 100644 index 00000000000..9846e33cd9f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr39712.c @@ -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; +}