aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-09-20 23:19:36 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2007-09-20 23:19:36 +0200
commit786025ea79bffb3746e1964e561dae17f37dc8af (patch)
tree29a12a54176cdbb269b5985bcd5053b8b884383b /gcc/testsuite/gcc.dg
parent334a954334bb79ff5acfbbc42759524965db2026 (diff)
downloadgcc-786025ea79bffb3746e1964e561dae17f37dc8af.zip
gcc-786025ea79bffb3746e1964e561dae17f37dc8af.tar.gz
gcc-786025ea79bffb3746e1964e561dae17f37dc8af.tar.bz2
re PR c/33238 (ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502)
PR c/33238 PR c/27301 * gimplify.c (gimplify_vla_decl): New function. (gimplify_decl_expr): Move VLA decl handling to gimplify_vla_decl. Call it. (gimplify_target_expr): Handle variable length TARGET_EXPRs. * gcc.c-torture/execute/20070919-1.c: New test. * gcc.dg/pr33238.c: New test. * gcc.dg/pr27301.c: New test. From-SVN: r128629
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/pr27301.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr33238.c12
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr27301.c b/gcc/testsuite/gcc.dg/pr27301.c
new file mode 100644
index 0000000..3b5a8f5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr27301.c
@@ -0,0 +1,15 @@
+/* PR c/27301 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu89" } */
+
+void
+foo (void *ptr, long n)
+{
+ __asm__ __volatile__ ("" :: "m" (({ struct { char x[n]; } *p = ptr; *p; })));
+}
+
+void
+bar (void *ptr, long n)
+{
+ __asm__ __volatile__ ("" :: "m" (*({ struct { char x[n]; } *p = ptr; p; })));
+}
diff --git a/gcc/testsuite/gcc.dg/pr33238.c b/gcc/testsuite/gcc.dg/pr33238.c
new file mode 100644
index 0000000..0b39904
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr33238.c
@@ -0,0 +1,12 @@
+/* PR c/33238 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+void
+reverse (void *x, int y, int z)
+{
+ struct { char w[z]; } *p = x, a;
+ int i, j;
+ for (i = y - 1, j = 0; j < y / 2; i--, j++)
+ ({ a = p[i]; p[i] = p[j]; p[j] = a; });
+}