aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/20050321-1.c
diff options
context:
space:
mode:
authorMostafa Hagog <mustafa@il.ibm.com>2005-03-21 18:49:29 +0000
committerMostafa Hagog <hagog@gcc.gnu.org>2005-03-21 18:49:29 +0000
commitd331e204024e2a74124880dd0dee8f4952fc9b26 (patch)
treef2b248b3f124017096da7b8acade677c20bf2d16 /gcc/testsuite/gcc.dg/20050321-1.c
parent191dd2c9c240ee8c8f8ea8f97e5361140d5af1de (diff)
downloadgcc-d331e204024e2a74124880dd0dee8f4952fc9b26.zip
gcc-d331e204024e2a74124880dd0dee8f4952fc9b26.tar.gz
gcc-d331e204024e2a74124880dd0dee8f4952fc9b26.tar.bz2
Fix PR middle-end/20177 and add test case.
From-SVN: r96828
Diffstat (limited to 'gcc/testsuite/gcc.dg/20050321-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/20050321-1.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20050321-1.c b/gcc/testsuite/gcc.dg/20050321-1.c
new file mode 100644
index 0000000..01c68cd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20050321-1.c
@@ -0,0 +1,26 @@
+/* This caused an ICE on powerpc-linux-gnu due to not
+ up-to-date life info (PR middle-end/20177). */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fmodulo-sched" } */
+extern void * malloc (long);
+
+struct s {
+ int k;
+};
+
+int n;
+struct s *a1, *(*use)[];
+float (*vector)[];
+
+void
+foo (float *V)
+{
+ int i, used = 0;
+
+ vector = malloc (i * sizeof (float));
+ while ((*use)[used] != a1)
+ used += 1;
+ for (i = 0; i < n; i++)
+ *V += (*vector)[i];
+}