[comp.windows.x] Building XQvss with GCC 1.35?

ben@cunixc.cc.columbia.edu (Ben Fried) (06/06/89)

System: VaxStation II running a Van TCP-enhanced Ultrix 2.0 kernel.

Sources: X11R3, patchlevel 8, with Purdue 2.0 & 2.1 speedups

I just compiled the gcc 1.35 sources, and attempted to make Xqvss, 
with CC set to: 

"gcc -fcombine-regs -fstrength-reduce -finline-functions \
-fpcc-struct-return -DPURDUE -Dinline=INLINE -DNOSTDHDRS" 

I got lots of errors in the ddx/mfb subdirectory - so many that I had to
compile it with pcc.  The rest of the compile went without incident, but
I still couldn't generate an Xqvss binary that actually worked.

Has anyone done this before?  If so, what am I doing wrong?  Or is this
a gcc bug manifesting itself?

Ben
-=-=-
ben@columbia.edu
ben@cunixc.cc.columbia.edu

spa%hara.fctunl.rccn.pt@MITVMA.MIT.EDU (06/06/89)

It's got to do with gcc's asm() thing, I got around the problem by
inserting a "=" character before the "g" in the asm() instructions
for FASTGETBITS() and FASTPUTBITS() in file ddx/mfb/maskbits.h.

Try the following patch (apply with patch -l because BITNET mailers
mung tabs...)

*** maskbits.h~ Mon Feb  6 15:10:57 1989
--- maskbits.h  Mon Jun  5 17:49:11 1989
***************
*** 315,321
  #ifdef vax
  #define FASTGETBITS(psrc,x,w,dst) \
      asm ("extzv %1,%2,%3,%0" \
!        : "g" (dst) \
         : "g" (x), "g" (w), "m" (*(char *)(psrc)))
  #define getbits(psrc,x,w,dst) FASTGETBITS(psrc,x,w,dst)


--- 315,321 -----
  #ifdef vax
  #define FASTGETBITS(psrc,x,w,dst) \
      asm ("extzv %1,%2,%3,%0" \
!        : "=g" (dst) \
         : "g" (x), "g" (w), "m" (*(char *)(psrc)))
  #define getbits(psrc,x,w,dst) FASTGETBITS(psrc,x,w,dst)

***************
*** 321,327

  #define FASTPUTBITS(src, x, w, pdst) \
      asm ("insv %3,%1,%2,%0" \
!        : "m" (*(char *)(pdst)) \
         : "g" (x), "g" (w), "g" (src))
  #define putbits(src, x, w, pdst) FASTPUTBITS(src, x, w, pdst)
  #endif vax

--- 321,327 -----

  #define FASTPUTBITS(src, x, w, pdst) \
      asm ("insv %3,%1,%2,%0" \
!        : "=m" (*(char *)(pdst)) \
         : "g" (x), "g" (w), "g" (src))
  #define putbits(src, x, w, pdst) FASTPUTBITS(src, x, w, pdst)
  #endif vax
---
Salvador Pinto Abreu                  BITNET/Internet: spa@fctunl.rccn.pt
 +---------------------------------+             UUCP: spa@unl.uucp
 |   Departamento de Informatica   +----------------------------------+
 |   Universidade Nova de Lisboa      2825 Monte Caparica, PORTUGAL   |
 +--------------------------------------------------------------------+

grunwald@flute.cs.uiuc.edu (Dirk Grunwald) (06/06/89)

this is, I think, an Xqvss bug, not a gcc bug.

whoever cobbled together the Xqvss driver made unsafe assumptions
about the optimizer - in particular, you have to compile everything
with -fvolatile & even then I'm not certain it will work properly.
--
Dirk Grunwald -- Univ. of Illinois 		  (grunwald@flute.cs.uiuc.edu)

grunwald@flute.cs.uiuc.edu (Dirk Grunwald) (06/06/89)

Whops, I was thinking of the *Xqdss* driver, not Xqvss. I haven't tried
Xqdss, since we don't have one. When I did try to compile Xqvss with gcc
(about 1.30, I think) it would compile but hang when running because
of spin-loops that were to delay while display registers get loaded, etc.
--
Dirk Grunwald -- Univ. of Illinois 		  (grunwald@flute.cs.uiuc.edu)