aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-05-03 19:57:32 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-05-03 19:57:32 +0000
commit255d3827b4ecd22efa38467bf52a9ee24f96afb5 (patch)
treec4e6b2079d241859aabc7e14a7760df92602eee4 /gcc/testsuite
parent16c337707b0c71829fcad74fdc82d85b1f103eaf (diff)
downloadgcc-255d3827b4ecd22efa38467bf52a9ee24f96afb5.zip
gcc-255d3827b4ecd22efa38467bf52a9ee24f96afb5.tar.gz
gcc-255d3827b4ecd22efa38467bf52a9ee24f96afb5.tar.bz2
re PR c/39983 (ICE: type mismatch in address expression)
2009-05-03 Richard Guenther <rguenther@suse.de> 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
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr39983.c17
2 files changed, 22 insertions, 0 deletions
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 <rguenther@suse.de>
+
+ PR c/39983
+ * gcc.c-torture/compile/pr39983.c: New testcase.
+
2009-05-03 Joseph Myers <joseph@codesourcery.com>
* 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;
+}
+