From 255d3827b4ecd22efa38467bf52a9ee24f96afb5 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Sun, 3 May 2009 19:57:32 +0000 Subject: re PR c/39983 (ICE: type mismatch in address expression) 2009-05-03 Richard Guenther PR c/39983 * c-typeck.c (array_to_pointer_conversion): Do not built ADDR_EXPRs of arrays of pointer-to-element type. * c-gimplify.c (c_gimplify_expr): Revert change fixing up wrong ADDR_EXPRs after-the-fact. * c-common.c (strict_aliasing_warning): Strip pointer conversions for obtaining the original type. * builtins.c (fold_builtin_memset): Handle array types. (fold_builtin_memory_op): Handle folded POINTER_PLUS_EXPRs and array types * gcc.c-torture/compile/pr39983.c: New testcase. From-SVN: r147083 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/compile/pr39983.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr39983.c (limited to 'gcc/testsuite') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fe172c5..ded72e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-05-03 Richard Guenther + + PR c/39983 + * gcc.c-torture/compile/pr39983.c: New testcase. + 2009-05-03 Joseph Myers * gcc.dg/c99-complex-3.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39983.c b/gcc/testsuite/gcc.c-torture/compile/pr39983.c new file mode 100644 index 0000000..6708121 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr39983.c @@ -0,0 +1,17 @@ +typedef struct { + int *p; +} *A; + +extern const int a[1]; +extern const int b[1]; + +void foo() +{ + A x; + A y; + static const int * const c[] = { b }; + + x->p = (int*)c[0]; + y->p = (int*)a; +} + -- cgit v1.1