aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-02-08 15:28:01 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-02-08 15:28:01 +0000
commit31432e219f044eb7195b9f802db88ace3e7fe8a1 (patch)
tree1efa0d6fbc6e7f4dd31d427ac6c423dc2e46bc4e /libgomp
parentc51ec0a3d68c86ba9b2e2d0c61556fee8308d570 (diff)
downloadgcc-31432e219f044eb7195b9f802db88ace3e7fe8a1.zip
gcc-31432e219f044eb7195b9f802db88ace3e7fe8a1.tar.gz
gcc-31432e219f044eb7195b9f802db88ace3e7fe8a1.tar.bz2
re PR tree-optimization/46886 (wrong code with -ftree-parallelize-loops -fno-tree-ch)
2012-03-08 Richard Guenther <rguenther@suse.de> PR tree-optimization/46886 * tree-flow.h (do_while_loop_p): Declare. * tree-ssa-loop-ch.c (do_while_loop_p): Export. * tree-parloops.c (parallelize_loops): Only parallelize do-while loops. * testsuite/libgomp.c/pr46886.c: New testcase. From-SVN: r184010
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c/pr46886.c28
2 files changed, 33 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 8d9015d..daebf23 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/46886
+ * testsuite/libgomp.c/pr46886.c: New testcase.
+
2012-01-25 Matthias Klose <doko@ubuntu.com>
* config/linux/arm: Remove empty directory.
diff --git a/libgomp/testsuite/libgomp.c/pr46886.c b/libgomp/testsuite/libgomp.c/pr46886.c
new file mode 100644
index 0000000..fbdc4e1
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr46886.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O -ftree-parallelize-loops=4 -fno-tree-ch -fno-tree-dominator-opts" } */
+
+void abort(void);
+
+int d[1024], e[1024];
+
+int foo (void)
+{
+ int s = 0;
+ int i;
+ for (i = 0; i < 1024; i++)
+ s += d[i] - e[i];
+ return s;
+}
+
+int main ()
+{
+ int i;
+ for (i = 0; i < 1024; i++)
+ {
+ d[i] = i * 2;
+ e[i] = i;
+ }
+ if (foo () != 1023 * 1024 / 2)
+ abort ();
+ return 0;
+}