aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-04-18 22:10:48 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2002-04-18 22:10:48 +0200
commita48632153d7f6013126d9a73125fbef7c05268c4 (patch)
tree91580e7aab79319ad4f22055c99f94baf53de373 /gcc
parent96b453dc817b2af01b88e22f4e57394b79342339 (diff)
downloadgcc-a48632153d7f6013126d9a73125fbef7c05268c4.zip
gcc-a48632153d7f6013126d9a73125fbef7c05268c4.tar.gz
gcc-a48632153d7f6013126d9a73125fbef7c05268c4.tar.bz2
PR optimization/5887, PR optimization/6010
PR optimization/5887, PR optimization/6010 * gcc.dg/20020418-1.c: New test. * gcc.dg/20020418-2.c: New test. From-SVN: r52492
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/20020418-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/20020418-2.c21
3 files changed, 52 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2a2aeda..00405d8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-18 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/20020418-1.c: New test.
+ * gcc.dg/20020418-2.c: New test.
+
2002-04-18 Richard Henderson <rth@redhat.com>
* gcc.c-torture/compile/iftrap-1.c: New.
diff --git a/gcc/testsuite/gcc.dg/20020418-1.c b/gcc/testsuite/gcc.dg/20020418-1.c
new file mode 100644
index 0000000..308bfa3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20020418-1.c
@@ -0,0 +1,26 @@
+/* PR optimization/5887 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -msse -ffast-math" { target i?86-*-* } } */
+
+void bar (float *a, float *b);
+
+void foo (char *x)
+{
+ float a, b;
+ char c[256];
+ int i, j;
+
+ bar (&a, &b);
+ for (i = 0; i < 256; i++)
+ {
+ float v = a;
+ if (v < 0.0f) v = 0.0f;
+ if (v < 255.0f) v = 255.0f;
+ c[i] = v;
+ a += b;
+ }
+
+ for (j = 0; j < 256; j++)
+ x[j] = c[j];
+}
diff --git a/gcc/testsuite/gcc.dg/20020418-2.c b/gcc/testsuite/gcc.dg/20020418-2.c
new file mode 100644
index 0000000..fbc38da
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20020418-2.c
@@ -0,0 +1,21 @@
+/* PR optimization/6010 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funroll-all-loops" } */
+/* { dg-options "-O2 -funroll-all-loops -march=pentium3" { target i?86-*-* } } */
+
+void bar (float);
+
+void foo (float y, unsigned long z)
+{
+ int b;
+ float c = y;
+
+ for (b = 0; b < z; b++)
+ {
+ bar (c);
+ if (c == y)
+ c = -y;
+ else
+ c = y;
+ }
+}