This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

New test gcc.c-torture/compile/20011229-1.c committed: MMIX bug.


Exercising the MMIX port by compiling and running some real
programs.  Ghostscript isn't suitable for cross-builds and
testing (too much tweaking and patching needed), so I'll not
try to generalize things for a wider audience.

The bug looks like one of those invalid substitutions (only a
reg+reg or reg+0..255 or symbol is allowed as address here),
but could very well be a bug in the port. ;-) Though no
obvious bogosity jumped out at me when I looked at the call
and *call_real patterns and mmix_symbolic_or_address_operand
predicate.  FWIW, reg 254 is the stack-pointer.  Another funny
thing is that the offset isn't negative (8) from sp for what I
think is a invalidly substituted stack-slot, though
STACK_GROWS_DOWNWARD.

.../gcc/testsuite/gcc.c-torture/compile/20011229-1.c: In function `image_render_color':^
.../gcc/testsuite/gcc.c-torture/compile/20011229-1.c:78: insn does not satisfy its constraints:
(call_insn 148 147 149 (parallel[
            (call (mem:QI (mem:DI (plus:DI (reg/f:DI 254 $254)
                            (const_int 8 [0x8])) [24 map_4 S8 A64]) [0 S1 A8])
                (const_int 0 [0x0]))
            (use (reg 20 $20))
            (clobber (reg:DI 259 rJ))
        ] ) 51 {*call_real} (insn_list 144 (insn_list 145 (insn_list 146 (insn_list 147 (nil)))))
    (nil)
    (expr_list (use (reg:DI 19 $19))
        (expr_list (use (reg:DI 18 $18))
            (expr_list (use (reg:DI 17 $17))
                (expr_list (use (reg:DI 16 $16))
                    (nil))))))


Until I get well enough from this flu to fix it, I've committed
this, which fails at -O2 and -O3, not at -Os or -O1:

	* gcc.c-torture/compile/20011229-1.c: New test.

*** /dev/null	Tue Jan  1 05:00:00 1980
--- gcc.c-torture/compile/20011229-1.c	Sat Dec 29 10:55:26 2001
***************
*** 0 ****
--- 1,78 ----
+ /* ICE: call insn does not satisfy its constraints, MMIX port.
+    Origin: ghostscript-6.52, reduction from hp@bitrange.com.  */
+ struct s0
+ {
+   void (*init_color)(void *, void *);
+ };
+ struct s1
+ {
+   void (*map_cmyk)(short, void *, void **, void *);
+   void (*map_rgb_alpha)(short, void *, void **, void *);
+ };
+ struct s5
+ {
+   long fill1; int fill2;
+   long fill3; unsigned int fill4, fill5;
+ };
+ struct s2
+ {
+   struct s5 x, y;
+ };
+ struct s3
+ {
+   long dev_color;
+   unsigned int key;
+ };
+ struct s4
+ {
+   unsigned char spp;
+   int alpha;
+   struct mc_
+   {
+     unsigned int values[14];
+     unsigned int mask, test;
+     int exact;
+   } mask_color;
+   void **pis;
+   struct s0 *pcs;
+   struct dd_
+   {
+     struct s2 row[2];
+     struct s2 pixel0;
+   } dda;
+   struct s3 clues[256];
+ };
+ extern struct s1 *get_cmap_procs (void **, void *);
+ int image_render_color (struct s4 *, unsigned char *, int, void *);
+ int
+ image_render_color (struct s4 *penum, unsigned char *buffer,
+ 		    int data_x, void *dev)
+ {
+   struct s3 *clues = penum->clues;
+   void **pis = penum->pis;
+   struct s2 pnext;
+   struct s0 *pcs = penum->pcs;
+   struct s1 *cmap_procs = get_cmap_procs(pis, dev);
+   void (*map_4)(short, void *, void **, void *) =
+     (penum->alpha ? cmap_procs->map_rgb_alpha : cmap_procs->map_cmyk);
+   unsigned int mask = penum->mask_color.mask;
+   unsigned int test = penum->mask_color.test;
+   struct s3 *pic_next = &clues[1];
+   int spp = penum->spp;
+   unsigned char *psrc = buffer + data_x * spp;
+   unsigned char v[6];
+
+   pnext = penum->dda.pixel0;
+   __builtin_memset (&v, 0, sizeof(v));
+   (*(pcs)->init_color) (0, 0);
+
+   if (spp == 4)
+     {
+       v[0] = psrc[0];
+       v[1] = psrc[1];
+       if ((buffer[0] & mask) == test && penum->mask_color.exact)
+ 	pic_next->dev_color = 0;
+       (*map_4)(v[0], &pic_next->dev_color, pis, dev);
+     }
+   return 0;
+ }

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]