Gcc vs Watcom

I’m in the process of porting our C++ code from QNX4 to QNX RTP.
Previously we used Watcom 10.6 and finally I managed to compile the code by
gcc.
I’ve got to say it’s was not an easy task, gcc seems to be much more
scrupulous in interpreting C++ language than WC was.
Also I’ve noticed 2 major differences between these 2 compilers
(the support of fancy C++ features is out of the scope right now)

  1. Watcom is about 1.5 times faster then gcc on identical machines.
  2. The code size generated by GCC is twice larger than code generated by WC!

If the 1st point is Ok, the second one bothers me. I tried to compile with
all optimization options ‘on’ on both compilers and this ratio stayed still
the same.

Can anyone tell me if there are any investigations done about code quality
produced by Gcc (C++ language) for QNX RTP or any comparisons between Watcom
and GCC ?
Though I guess QSSL should have done this before adopting gcc as the primary
compiler of QNX RTP. If this info can be disclosed I’d greatly appreciate
it.

cheers,
Igor
ilevko@applanix.com

“Igor Levko” <no_spam@nihrena.net> wrote in message
news:a1f47k$aoh$1@inn.qnx.com

I’m in the process of porting our C++ code from QNX4 to QNX RTP.
Previously we used Watcom 10.6 and finally I managed to compile the code
by
gcc.
I’ve got to say it’s was not an easy task, gcc seems to be much more
scrupulous in interpreting C++ language than WC was.
Also I’ve noticed 2 major differences between these 2 compilers
(the support of fancy C++ features is out of the scope right now)

  1. Watcom is about 1.5 times faster then gcc on identical machines.

Only 1.5, your lucky :wink:

  1. The code size generated by GCC is twice larger than code generated by
    WC!

I think the option -fno-inline (from memory) can reduce executable size.

If the 1st point is Ok, the second one bothers me. I tried to compile with
all optimization options ‘on’ on both compilers and this ratio stayed
still
the same.

Can anyone tell me if there are any investigations done about code
quality
produced by Gcc (C++ language) for QNX RTP or any comparisons between
Watcom
and GCC ?

It doesn’t really matter, see Watcom is out of the business and does not
support
other processor then x86 anyway. QSSL were forced to move away from
Watcom. We can compare all we want, talk about this issue, it won’t
change a thing, Watcom’s dead. (It went open source lately though)

Though I guess QSSL should have done this before adopting gcc as the
primary
compiler of QNX RTP. If this info can be disclosed I’d greatly appreciate
it.



cheers,
Igor
ilevko@applanix.com
\

“Mario Charest” <goto@nothingness.com> wrote in message
news:a1frlk$qbg$1@inn.qnx.com

“Igor Levko” <> no_spam@nihrena.net> > wrote in message
news:a1f47k$aoh$> 1@inn.qnx.com> …
I’m in the process of porting our C++ code from QNX4 to QNX RTP.
Previously we used Watcom 10.6 and finally I managed to compile the code
by
gcc.
I’ve got to say it’s was not an easy task, gcc seems to be much more
scrupulous in interpreting C++ language than WC was.
Also I’ve noticed 2 major differences between these 2 compilers
(the support of fancy C++ features is out of the scope right now)

  1. Watcom is about 1.5 times faster then gcc on identical machines.

Only 1.5, your lucky > :wink:

I have also got same result that gcc is slower then watcom.

We have generally used the option ‘-O2’ for the speed optimization.
What is the most fast option in gcc ?

  1. The code size generated by GCC is twice larger than code generated by
    WC!


    I think the option -fno-inline (from memory) can reduce executable size.

If the 1st point is Ok, the second one bothers me. I tried to compile
with
all optimization options ‘on’ on both compilers and this ratio stayed
still
the same.

Can anyone tell me if there are any investigations done about code
quality
produced by Gcc (C++ language) for QNX RTP or any comparisons between
Watcom
and GCC ?

It doesn’t really matter, see Watcom is out of the business and does not
support
other processor then x86 anyway. QSSL were forced to move away from
Watcom. We can compare all we want, talk about this issue, it won’t
change a thing, Watcom’s dead. (It went open source lately though)

Though I guess QSSL should have done this before adopting gcc as the
primary
compiler of QNX RTP. If this info can be disclosed I’d greatly
appreciate
it.



cheers,
Igor
ilevko@applanix.com


\

I have also got same result that gcc is slower then watcom.

We have generally used the option ‘-O2’ for the speed optimization.
What is the most fast option in gcc ?

I haven’t play with all GCC option, but in general not using -Ox
(no optimisation) will be faster.

I also got a slice increase in speed by preload all the gcc binaries
with on -h XXX.

Using make -j2 also helps.

But don’t hold your breath, no way it’s getting close to Watcom speed.

  • Mario

Mario Charest <goto@nothingness.com> wrote:

I have also got same result that gcc is slower then watcom.

We have generally used the option ‘-O2’ for the speed optimization.
What is the most fast option in gcc ?

I haven’t play with all GCC option, but in general not using -Ox
(no optimisation) will be faster.

I also got a slice increase in speed by preload all the gcc binaries
with on -h XXX.

Using make -j2 also helps.

But don’t hold your breath, no way it’s getting close to Watcom speed.

those will probably improve the compilation speed, but will not do
any good to the resulting executable.

I thought using -O3 would be more efficient (at the price of size…)
because it will do some inlining.

We change from no -O option to -O3 and that was rather dramatic!

Didier.

“Byoung-Hweh Huh” <purunsan@orgio.net> a écrit dans le message de news:
a1galp$69k$1@inn.qnx.com

“Mario Charest” <> goto@nothingness.com> > wrote in message
news:a1frlk$qbg$> 1@inn.qnx.com> …

“Igor Levko” <> no_spam@nihrena.net> > wrote in message
news:a1f47k$aoh$> 1@inn.qnx.com> …
I’m in the process of porting our C++ code from QNX4 to QNX RTP.
Previously we used Watcom 10.6 and finally I managed to compile the
code
by
gcc.
I’ve got to say it’s was not an easy task, gcc seems to be much more
scrupulous in interpreting C++ language than WC was.
Also I’ve noticed 2 major differences between these 2 compilers
(the support of fancy C++ features is out of the scope right now)

  1. Watcom is about 1.5 times faster then gcc on identical machines.

Only 1.5, your lucky > :wink:

I have also got same result that gcc is slower then watcom.

We have generally used the option ‘-O2’ for the speed optimization.
What is the most fast option in gcc ?


2. The code size generated by GCC is twice larger than code generated
by
WC!


I think the option -fno-inline (from memory) can reduce executable size.

If the 1st point is Ok, the second one bothers me. I tried to compile
with
all optimization options ‘on’ on both compilers and this ratio stayed
still
the same.

Can anyone tell me if there are any investigations done about code
quality
produced by Gcc (C++ language) for QNX RTP or any comparisons between
Watcom
and GCC ?

It doesn’t really matter, see Watcom is out of the business and does not
support
other processor then x86 anyway. QSSL were forced to move away from
Watcom. We can compare all we want, talk about this issue, it won’t
change a thing, Watcom’s dead. (It went open source lately though)

Though I guess QSSL should have done this before adopting gcc as the
primary
compiler of QNX RTP. If this info can be disclosed I’d greatly
appreciate
it.



cheers,
Igor
ilevko@applanix.com




\

Didier Harrang <didier.harrang@bcisa.com> wrote:

I thought using -O3 would be more efficient (at the price of size…)
because it will do some inlining.

As I mentioned in another post, Mario is probably talking about
improving the gcc compile speed. Of course, if you disabled
optimization, gcc won’t spend much time trying to optimise your
code, gcc will then runs faster.


We change from no -O option to -O3 and that was rather dramatic!

Didier.

“Igor Levko” <no_spam@nihrena.net> wrote in message
news:a1f47k$aoh$1@inn.qnx.com

  1. The code size generated by GCC is twice larger than code generated by
    WC!

Can anyone tell me if there are any investigations done about code
quality
produced by Gcc (C++ language) for QNX RTP or any comparisons between
Watcom
and GCC ?
snip
Though I guess QSSL should have done this before adopting gcc as the
primary
compiler of QNX RTP. If this info can be disclosed I’d greatly appreciate
it.

This became an issue when we moved to using Dinkum libraries for C++.
Dinkum doesn’t allow for the removal of the exception code generation (AFAIK
it’s a violation of C++ std) as you could with the GNU C++ lib. This has
been addressed for the next release with the addition of the abridged C++
lib (for embedded systems).

The problem with Watcom is that it has many 16-bit’isms/legacy which makes
cross-platform targeting or porting nasty.


Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

Thanks everybody.
As I said, the compilation speed was not that important for now
But the quality of generated code is somewhat to worry about.
There was a comparison between Gcc and SunC++ on Sparc and it did
not look good for gcc at all.
I’m afraid that comparing gcc with watcom won’t be good for gcc either.

But Mario was absolutely right. There is simply no alternative!
Well, maybe gcc v.3 looks better …

cheers,
Igor

Does anyone know the status of Open Watcom?


\

Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Igor Levko” <no_spam@nihrena.net> wrote in message
news:a1httv$c1f$1@inn.qnx.com

Thanks everybody.
As I said, the compilation speed was not that important for now
But the quality of generated code is somewhat to worry about.
There was a comparison between Gcc and SunC++ on Sparc and it did
not look good for gcc at all.
I’m afraid that comparing gcc with watcom won’t be good for gcc either.

But Mario was absolutely right. There is simply no alternative!
Well, maybe gcc v.3 looks better …

cheers,
Igor

“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:a1humr$chc$1@inn.qnx.com

Does anyone know the status of Open Watcom?

www.openwatcom.org for the latest info


Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

Alas, they do not have any intentions to support QNX in foreseeable future.

cheers,
Igor

“Adam Mallory” <amallory@qnx.com> wrote in message
news:a1i8aa$qhk$1@nntp.qnx.com

“Bill Caroselli” <> qtps@earthlink.net> > wrote in message
news:a1humr$chc$> 1@inn.qnx.com> …
Does anyone know the status of Open Watcom?

www.openwatcom.org > for the latest info


Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

Another issue is that watcom is x86 only and I don’t believe it would be
trivial to support any other processors. It’s probably a little easier to
have a fast compiler making fast code when you only have to support one host
and one target. Not to take anything away from watcom but I think their c++
support is several years behind and I also expect that trying to support
other targets would take them back to square one, quite a bit behind gcc.
Of course, that’s just my opinion and not based on any facts in particular.
:wink:

cheers,

Kris

“Igor Levko” <no_spam@nihrena.net> wrote in message
news:a1k8qu$36n$1@inn.qnx.com

Alas, they do not have any intentions to support QNX in foreseeable
future.

cheers,
Igor

“Adam Mallory” <> amallory@qnx.com> > wrote in message
news:a1i8aa$qhk$> 1@nntp.qnx.com> …
“Bill Caroselli” <> qtps@earthlink.net> > wrote in message
news:a1humr$chc$> 1@inn.qnx.com> …
Does anyone know the status of Open Watcom?

www.openwatcom.org > for the latest info


Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

\

Someone should make it worth their while. (Hint, hint.)


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Igor Levko” <no_spam@nihrena.net> wrote in message
news:a1k8qu$36n$1@inn.qnx.com

Alas, they do not have any intentions to support QNX in foreseeable
future.

cheers,
Igor

“Adam Mallory” <> amallory@qnx.com> > wrote in message
news:a1i8aa$qhk$> 1@nntp.qnx.com> …
“Bill Caroselli” <> qtps@earthlink.net> > wrote in message
news:a1humr$chc$> 1@inn.qnx.com> …
Does anyone know the status of Open Watcom?

www.openwatcom.org > for the latest info


Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

\

“Kris Warkentin” <kewarken@qnx.com> wrote in message
news:a1kbfv$coh$1@nntp.qnx.com

Another issue is that watcom is x86 only and I don’t believe it would be
trivial to support any other processors. It’s probably a little easier to
have a fast compiler making fast code when you only have to support one
host
and one target. Not to take anything away from watcom but I think their
c++
support is several years behind and I also expect that trying to support
other targets would take them back to square one, quite a bit behind gcc.
Of course, that’s just my opinion and not based on any facts in
particular.
:wink:

Their 10.6 C++ was years behind. The 11.0 was very up to date (though I

won’t swear that it was completely up to date).

I haven’t written a compiler since school and certainly not one as complex
as Watcom C/C++. But it seams to me that the parsing pass is most of the
work. Code generation shouldn’t be THAT difficult. Even so, for now, I’d
be happy with an X86 only Watcom compiler for QNX.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

Bill Caroselli <qtps@earthlink.net> wrote:

I haven’t written a compiler since school and certainly not one as complex
as Watcom C/C++. But it seams to me that the parsing pass is most of the
work. Code generation shouldn’t be THAT difficult. Even so, for now, I’d
be happy with an X86 only Watcom compiler for QNX.

Parsing is easy. Generating code is easy. Generating good code (in a
reasonable amount of time) is very hard.


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

Well, gcc/gdb don’t work on QNX either until we monkey with them so if
Watcom is released in some form of source, there would be no reason we
couldn’t monkey with it as well. :wink:

BTW, my other posting was in error apparantly. A little ex-Watcom bird told
me that internally, Watcom had beta support for several other architectures
such as ppc, IBM 370, and alpha. So, perhaps our using watcom would be a
viable alternative if it were relatively easy to add other cpu support.
Ultimately it would come down to the amount of work to get Watcom going for
all our targets vs. the investment we have in the Gnu toolchain.

cheers,

Kris

“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:a1ket0$7ts$1@inn.qnx.com

Someone should make it worth their while. (Hint, hint.)


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Igor Levko” <> no_spam@nihrena.net> > wrote in message
news:a1k8qu$36n$> 1@inn.qnx.com> …
Alas, they do not have any intentions to support QNX in foreseeable
future.

cheers,
Igor

“Adam Mallory” <> amallory@qnx.com> > wrote in message
news:a1i8aa$qhk$> 1@nntp.qnx.com> …
“Bill Caroselli” <> qtps@earthlink.net> > wrote in message
news:a1humr$chc$> 1@inn.qnx.com> …
Does anyone know the status of Open Watcom?

www.openwatcom.org > for the latest info


Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net



\

Hi Kris

I’m not surprised about the 370. Didn’t Watcom get their start writing
mainframe software?

Yippie for monkies! I’m all for it. Since we’re speaking competely
hypothetically, would it be necessary for there to be support for all (or
even most) hardware platforms before QSSL would consider promoting Open
Watcom?

I would venture to guess that so far X86 is still by far the most popular
processor that RTP is being used on. (Though it has certainly outgrown it’s
usefullness.) So, let’s pretend for a moment that QSSL ports Open Watcom
and gets it to work for X86. Then, I’ll bet a bunch of us would try it and
say, “Oh my gosh this Watcom compiler is much better, faster and produces
better code than the GNU compiler.” Then, I’ll bet the folks using the
other hardware platforms would say, “Oh golly gee. If only the Watcom
compiler were available for my patform too!”

OK. Re-reading your post I notice your comment on return on investment. I
know that I’m already considered the cry-baby over there at QSSL but it
occurs to me that it would be very much worth QSSL’s while to find a better
compiler. RTP is supposed to be the “Real-Time” platform. And while I love
all of the new features of RTP, the fact is that almost across the board
QNX4 clocks in faster than similar routines written in RTP. Personally I
think that is largely the fault of the compiler.

Of course I’m being completely hypothetical. So while we’re on that
thought, let’s just all pretent that I won the lottery. Gee, I feel better
already.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Kris Warkentin” <kewarken@qnx.com> wrote in message
news:a1kk8g$ie7$1@nntp.qnx.com

Well, gcc/gdb don’t work on QNX either until we monkey with them so if
Watcom is released in some form of source, there would be no reason we
couldn’t monkey with it as well. > :wink:

BTW, my other posting was in error apparantly. A little ex-Watcom bird
told
me that internally, Watcom had beta support for several other
architectures
such as ppc, IBM 370, and alpha. So, perhaps our using watcom would be a
viable alternative if it were relatively easy to add other cpu support.
Ultimately it would come down to the amount of work to get Watcom going
for
all our targets vs. the investment we have in the Gnu toolchain.

cheers,

Kris

Igor Levko <no_spam@nihrena.net> wrote in article <a1httv$c1f$1@inn.qnx.com>…

Thanks everybody.
As I said, the compilation speed was not that important for now
But the quality of generated code is somewhat to worry about.
There was a comparison between Gcc and SunC++ on Sparc and it did
not look good for gcc at all.
I’m afraid that comparing gcc with watcom won’t be good for gcc either.

I was playing around something very similar last night :wink: I tried to compare execution speed for
different builds of the same mpeg3 encoder (BladeEnc 0.94.2)
There was faster code in case “gcc -O2” (not -O3)
The wav was about 30 Meg, bitrate and other setting of compression the same, the same hardware:
p166mmx/64mb ram

  1. exec time 2:24, windows console application, Intel (R) C++ Compiler for 32-bit
    applications,version 5.0, optimized for pentium;
  2. exec time 2:40, dos application with 32-bit extender, have no info on compiler, optimized for
    pentium;
  3. exec time 2:50, qnxrtp 6.1A, gcc -O2 -mcpu=pentium (I did not find anything yet to make it
    faster)
  4. exec time 3:15, qnxrtp 6.1A, gcc -O2 -mcpu=i386 or single -O2 :wink:

And I have question: where is good documentation on gcc? I don’t wish a ton of articles and docs, I
wish to read compact information on optimizing for different processors, nothing more…

I did not care about size at this time, but I know useful command only because I’m browsing these
newsgroups (btw, should not it be capitalized in red paragraph in QNX documentation, since QNX is
for embedded?)

strip --strip-unneeded -R.comment

BTW it leaves the string “01.01 01.01 …” What is it? What this string useful for?

But Mario was absolutely right. There is simply no alternative!
Well, maybe gcc v.3 looks better …

Give me the piece of your optimism :wink:

Best regards,
Eduard.


cheers,
Igor

I wonder, why other compiler vendors do not support QNX.
Look, there was one compiler for QNX4 and again Gcc is
the only compiler available for QNX RTP (as far as I know).

IMHO, I doubt it’s such a big task to port any commercial unix x86 compiler
to QNX 6 x86. Though, I understand, that normally /usr/include & libC come
with
OS, thus It’s OS vendor who rules here and if it does not
want any competition with the “original” compiler no one will even try.
Which is fine only if OS vendor provides “state of the art” compiler
technology.
Unfortunaterly gcc 2.9 seems to be not this type of development tool.

Bill was quite right. QNX is for embedded systems first of all.
Size and speed are still important aspects of any embedded application.

cheers,
Igor

“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:a1kq1f$fgu$1@inn.qnx.com

Hi Kris

I’m not surprised about the 370. Didn’t Watcom get their start writing
mainframe software?

Yippie for monkies! I’m all for it. Since we’re speaking competely
hypothetically, would it be necessary for there to be support for all (or
even most) hardware platforms before QSSL would consider promoting Open
Watcom?

I would venture to guess that so far X86 is still by far the most popular
processor that RTP is being used on. (Though it has certainly outgrown
it’s
usefullness.) So, let’s pretend for a moment that QSSL ports Open Watcom
and gets it to work for X86. Then, I’ll bet a bunch of us would try it
and
say, “Oh my gosh this Watcom compiler is much better, faster and produces
better code than the GNU compiler.” Then, I’ll bet the folks using the
other hardware platforms would say, “Oh golly gee. If only the Watcom
compiler were available for my patform too!”

OK. Re-reading your post I notice your comment on return on investment.
I
know that I’m already considered the cry-baby over there at QSSL but it
occurs to me that it would be very much worth QSSL’s while to find a
better
compiler. RTP is supposed to be the “Real-Time” platform. And while I
love
all of the new features of RTP, the fact is that almost across the board
QNX4 clocks in faster than similar routines written in RTP. Personally I
think that is largely the fault of the compiler.

Of course I’m being completely hypothetical. So while we’re on that
thought, let’s just all pretent that I won the lottery. Gee, I feel
better
already.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net