]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/38948 (unrecognizable insn, postreload.c:395)
authorHans-Peter Nilsson <hp@axis.com>
Tue, 13 Oct 2009 23:49:46 +0000 (23:49 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Tue, 13 Oct 2009 23:49:46 +0000 (23:49 +0000)
PR target/38948
* gcc.dg/torture/pr38948.c: New test.

From-SVN: r152737

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr38948.c [new file with mode: 0644]

index d4e11af3a3e168e1377ec54e51dd6d8c7716e68c..78e571557dc2a4b58083a2d59ebdaeba65e3b098 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-14  Hans-Peter Nilsson  <hp@axis.com>
+
+       PR target/38948
+       * gcc.dg/torture/pr38948.c: New test.
+
 2009-10-12  Hans-Peter Nilsson  <hp@axis.com>
 
        PR target/26515
diff --git a/gcc/testsuite/gcc.dg/torture/pr38948.c b/gcc/testsuite/gcc.dg/torture/pr38948.c
new file mode 100644 (file)
index 0000000..98ed493
--- /dev/null
@@ -0,0 +1,101 @@
+/* { dg-options "-fno-tree-sra" } */
+/* { dg-options "-fno-tree-sra -march=v32" { target cris-*-* } } */
+typedef unsigned char byte;
+typedef unsigned int uint;
+typedef int bool;
+typedef struct gs_const_string_s
+{
+  const byte *data;
+}
+gs_const_string;
+struct gs_matrix_s
+{
+  float xx, xy, yx, yy, tx, ty;
+};
+typedef struct gs_matrix_s gs_matrix;
+typedef long fixed;
+typedef struct gs_fixed_point_s
+{
+  fixed x, y;
+}
+gs_fixed_point;
+typedef struct gs_matrix_fixed_s
+{
+  int x;
+}
+gs_matrix_fixed;
+static int
+append_simple (const byte * glyph, const gs_matrix_fixed * pmat, void * ppath)
+{
+  int numContours =
+    (int) (((((uint) ((glyph)[0]) << 8) + (glyph)[1]) ^ 0x8000) - 0x8000);
+  const byte *pends = glyph + 10;
+  int code = 0;
+  {
+    uint i = 0;
+    uint np = 0;
+    gs_fixed_point pt = {0};
+    uint reps = 0;
+    for (i = 0, np = 0; i < numContours; ++i)
+      {
+       bool move = ((bool) 1);
+       uint last_point =
+         (((uint) ((pends + i * 2)[0]) << 8) + (pends + i * 2)[1]);
+       int off_curve = 0;
+       gs_fixed_point cpoints[3];
+       for (; np <= last_point; --reps, ++np)
+         {
+           if (move)
+             {
+               cpoints[0] = pt;
+               move = ((bool) 0);
+             }
+           else
+             {
+               switch (off_curve++)
+                 {
+                 default:
+                   cpoints[2].x = ((cpoints[1].x + pt.x) / 2);
+                   cpoints[2].y = ((cpoints[1].y + pt.y) / 2);
+                   code =
+                     gx_path_add_curve_notes (ppath,
+                                              ((cpoints[0].x +
+                                                2 * cpoints[1].x) / 3),
+                                              ((cpoints[0].y +
+                                                2 * cpoints[1].y) / 3),
+                                              ((2 * cpoints[1].x +
+                                                cpoints[2].x) / 3),
+                                              ((2 * cpoints[1].y +
+                                                cpoints[2].y) / 3),
+                                              cpoints[2].x, cpoints[2].y,
+                                              0);
+                   cpoints[0] = cpoints[2];
+                 case 0:
+                   cpoints[1] = pt;
+                 }
+             }
+         }
+      }
+  }
+}
+int
+append_outline (uint glyph_index, const gs_matrix_fixed *pmat, void *ppath)
+{
+  gs_const_string glyph_string = {0};
+  int numContours = 0;
+  numContours =
+    (int) (((((uint) ((glyph_string.data)[0]) << 8) +
+            (glyph_string.data)[1]) ^ 0x8000) - 0x8000);
+  if (numContours >= 0)
+    return append_simple (glyph_string.data, pmat, ppath);
+  {
+    uint flags = 0;
+    do
+      {
+       gs_matrix_fixed mat = {0};
+       gs_matrix scale_mat = {0};
+       gs_matrix_multiply (&scale_mat, (const gs_matrix *) &mat, (gs_matrix *) & mat);
+      }
+    while (flags & 32);
+  }
+}