Przemek:

 HB_BUILD_OPTIM := no

Thank you very much. This is what I wanted to see :-)

So all what we have to do is finding/adding method to disable
only -s switch when GTOS2 is compiled by OpenWatcom.
HB_BUILD_OPTIM := no disables all optimizations so we need
something more selective here.
Unfortunately we do not have switch to revert previously set -s
but maybe we can find other switch which also resolves the problem.
So far we know that -sg also resolves it. So in first step I'll add
this code to src/rtl/gtos2/Makefile[15]:

  ifeq ($(HB_COMPILER),watcom)
     HB_CFLAGS += -sg
  endif

and I'll commit it in a while. If possible please test.

From previous tests only -s removed avoid GPF
A year ago -sg increased run time, but today we have new Harbour and new
OpenWatcom

Then if you want then you can try also few other switches instead of:
     HB_CFLAGS += -sg
in src/rtl/gtos2/Makefile. The following switches are stack related and
it's possible that also some of them can help:
     HB_CFLAGS += -st
     HB_CFLAGS += -zu
     HB_CFLAGS += -of+
To reduce the time necessary for tests just simply replace -sg with
one of the above switches delete src/rtl/gtos2/obj directory and call
make install. Then recompile speedtst in MT mode and check if
  speedtst --thread
works without GPF. If some of above switches will help to resolve
the problem then later we can try to chose the one which has smallest
speed overhead on final code.
It's also possible that some combination of switches for segment registers
can resolve the problem so you can try them. In OpenWatcom I've found
the following switches which operates on it.
  -zdf            DS floats (i.e. not fixed to DGROUP)
  -zdl            load DS directly from DGROUP
  -zdp            DS is pegged to DGROUP
  -zff            FS floats (i.e. not fixed to a segment)
  -zfp            FS is pegged to a segment
  -zgf            GS floats (i.e. not fixed to a segment)
  -zgp            GS is pegged to a segment

Using a fresh SVN and your instructions:
( sys1808 is GPF )
-sg  sys1808
-st  sys1808
-zu  sys1808
-of+ sys1808
-zdf sys1808
-zdl sys1808
-zdp sys1808
-zff sys1808
-zfp sys1808
-zgf sys1808
-zgp sys1808

Later, using in src/rtl/gtos2/Makefile
  HB_BUILD_OPTIM := no
I found in make_ow.log that switchs are:
 "-zq -bt=os2 -w3 -bm"
where "-s" does not exist
so I used
  HB_BUILD_OPTIM := no
and
  HB_CFLAGS += (switchs)
to test with different values

"-zq -bt=os2 -w3 -bm" + (switchs) results, including "[ total real time: ]":

-6r   23.67
-6r -fp6  23.72
-6r -fp6 -ei -zp4 -zt0 -oi+  23.56
-6r -fp6 -ei -zp4 -zt0 -oi+ -onaehtr  23.40
-6r -fp6 -ei -zp4 -zt0 -oi+ -onaehtr -sg  23.78
-6r -fp6 -ei -zp4 -zt0 -oi+ -onaehtr -sg -s sys1808

Perhaps is time to request help to OpenWatcom developers

Now is easy to make tests with and without "-s" switch and "speedtst
--thread" so they can review both cases
... and they can debug

A very brief guide for them:

- Harbour checkout
a) with "-s" switch
- Build Harbour
- Build and run "speedtst --thread"
  It GPF

b) without "-s" switch
- Clean Harbour
- Remove "-s" from:
  config\os2\watcom.mk
  utils\hbmk2\hbmk2.prg in OS/2 case
- Build Harbour
- Build and run "speedtst --thread"
  It does not GPF

So the speed overhead caused by compiling only GTOS2 without any
optimization and with stack overflow check code is minimal.
Very good.

I suppose same apply for gtstd

David Macias



_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to