aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2001-11-09 15:30:33 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2001-11-09 15:30:33 +0100
commita3d87e92eb015631e52c1408798ae4cf29d4703c (patch)
treeebe7b802597bbfe3c2bc5be07b4964176dfecd1b
parent7ade1c9cd7d8d70970ef4380be4e05679b16e3e9 (diff)
downloadgcc-a3d87e92eb015631e52c1408798ae4cf29d4703c.zip
gcc-a3d87e92eb015631e52c1408798ae4cf29d4703c.tar.gz
gcc-a3d87e92eb015631e52c1408798ae4cf29d4703c.tar.bz2
sparc.md (movdf): Avoid calling validize_mem during or after reload.
* config/sparc/sparc.md (movdf): Avoid calling validize_mem during or after reload. * gcc.c-torture/compile/20011109-1.c: New test. From-SVN: r46880
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sparc/sparc.md5
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20011109-1.c51
4 files changed, 65 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5cce4ad..add0d82 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-11-09 Jakub Jelinek <jakub@redhat.com>
+
+ * config/sparc/sparc.md (movdf): Avoid calling validize_mem during
+ or after reload.
+
2001-11-09 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/install.texi2html: Use $MAKEINFO --no-split.
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 9c35dcc..dad74dd 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -3134,6 +3134,11 @@
&& fp_zero_operand (operands[1], DFmode))
goto movdf_is_ok;
+ /* We are able to build any DF constant in integer registers. */
+ if (REGNO (operands[0]) < 32
+ && (reload_completed || reload_in_progress))
+ goto movdf_is_ok;
+
operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]),
operands[1]));
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index dc44d38..6d9c0f0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2001-11-09 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/compile/20011109-1.c: New test.
+
2001-11-08 Geoffrey Keating <geoffk@redhat.com>
* g++.old-deja/g++.bugs/900227_01.C: Change stormy16 to xstormy16.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20011109-1.c b/gcc/testsuite/gcc.c-torture/compile/20011109-1.c
new file mode 100644
index 0000000..f1987a74
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20011109-1.c
@@ -0,0 +1,51 @@
+typedef struct { short x[4]; } S;
+typedef struct { unsigned int a, b, c; S *d; } T;
+
+S *(*foo) (T *, int, int, int, int);
+unsigned short *(*bar)(const T *);
+unsigned short baz(T *,const int);
+
+T *die (void)
+{
+ typedef struct { unsigned int a, b, e; double f, g; } U;
+
+ char h[8], i[2053], j[2053];
+ double k, l, m;
+ U n;
+ T *o;
+ unsigned short p;
+ int q, r;
+ long s;
+ unsigned short *t;
+ S *u;
+ unsigned char *v, *w;
+ unsigned int x;
+
+ o = 0;
+ for (x = 0; x < n.e; x++)
+ {
+ l = 1.0;
+ if (n.g - n.f <= 1.0)
+ l = ((1 << o->c) - 1) / (n.g - n.f);
+ v = w;
+ for (r = o->b - 1; r >= 0; r--)
+ {
+ u = foo (o, 0, r, o->a, 1);
+ if (!u)
+ break;
+ t = bar (o);
+ for (q = 0; q < (int) o->a; q++)
+ {
+ h[0] = *v;
+ s = *v++;
+ k = (double) s;
+ m = l*k;
+ p = m < 0 ? 0 : m > (1 << o->c) - 1 ? (1 << o->c) - 1 : m + 0.5;
+ p = baz (o,p);
+ t[q] = p;
+ *u++ = o->d[p];
+ }
+ }
+ }
+ return o;
+}