Page 1 of 1

SGCC vs. XGCC - speed?

Posted: Sat Dec 08, 2007 11:15 am
by Shiru
Is somebody did speed tests of these compilers? I don't have XGCC installed and currently don't want to do this, so I'm interested if somebody already compared speed, or maybe want to do this (then we can decide which tests must be done and run it, I can take SGCC part).

Posted: Sat Dec 08, 2007 3:10 pm
by Fonzie
I did compare speed :)

Mightymighty Missile was programmed in a very loopy/linear way, so, when I went from SGCC to GCC (with a lot of pain, defining Volatiles & stuff) my fps counter exploded!

I don't have precise values, and I don't know if it came from my programming method... But with -O 4 on GCC, vs SGCC, I won almost 100% speed on my main loop code :)

Yeah, was something like 64fps>100fps when removing all wait_vsync() stuff.

So yeah, SGCC is buggy and do not optimize at all stuff.

Posted: Sat Dec 08, 2007 10:55 pm
by Chilly Willy
Might as well include modern gcc in that as well. I was able to get the gcc 4.1.1 for uClinux to compile Genesis code.

Posted: Sun Dec 09, 2007 12:07 am
by Shiru
So, seems it worth to move SGCC project to XGCC if it will have problems with speed.
Fonzie wrote:So yeah, SGCC is buggy and do not optimize at all stuff.
I saw some mentions about 'bugs' in SGCC, but never found one. Can you say which bugs it have?

Posted: Sun Dec 09, 2007 12:20 am
by Fonzie
By SGCC, you mean the very light exe suite to compile some md stuff, right? The one without any .ld.
Was my fav and first compilator... very easy to install and crazy easy to use ! :D

Well, kanedaFR can tell you all the bugs we could find... Most of them are scary...

I remember lot of bugs around pointers, random memory glitches...
Also, some calculus, in some cases like myvalue=3+i; were failling because you had to write myvalue=3; myvalue=myvalue+i; ;)
I also remember a glitches when using the & or | mask.
Another funny random glitch was the infamous "syntax error" when you were typing, lets say :
myvalue=3+myothervalue;
and you had to write :
myvalue= 3+myothervalue;
(adding a simple space fixed the problem).

Also, if you did while(1){}, it make crash the compilator ;)

Add a very sloooooow compilation speed in big projects and poor error tracking and you're done! :D haha
Still my fav compilator... However, I can't use it anymore, too scary.


--------------
To move from SGCC to XGGG, its quite simple, but you must be sure to do this :

-Move all the $ into 0x in asm files
-Correct all the asm syntax to XGCC standard
-char stay char, word goes short, int goes short, long goes int < VERY important, in SGCC, int is 16bit).
- Add volatile on all your register-used pointers variables

And it's done :)
Good luck!

Posted: Sun Dec 09, 2007 12:31 am
by Shiru
Seems you speak about some different SGCC, maybe older version? One which I use (Sozobon C Compiler, release 3.0, which in Tools section of SpritesMind site) has no such bugs. I already wrote some thousands lines of code and not found any mentioned bugs, all works exactly as planned. Documentation states:
The compiler has been tested with the "C Compiler Torture Test" from the Austin Code Works. This tests for full K&R compatibility. The compiler has been used to compile itself as well as many other programs totaling around 50,000 lines of code.
I don't think that all this was possible if it has bugs which you mentioned.

Posted: Sun Dec 09, 2007 12:40 am
by Fonzie
Maybe I had a older version... strange.
No, I was not dreaming, it has really some crazy bugs... Most of them are coming randomly on big project.
The bug that was happening systematically was the while(1){} one and the & and | thing. I don't remember the exact cases, sorry.

KanedaFR will confirm.
For me, going to SGCC to XGCC solved all my problems.

Posted: Sun Dec 09, 2007 12:47 am
by Shiru
Fonzie wrote:The bug that was happening systematically was the while(1){} one and the & and | thing. I don't remember the exact cases, sorry.
I placed while(1) {} into big project and indeed it freezes compiler. But this project uses a LOT of logical operations of all types (most of all code) and has no problems with it.
Fonzie wrote:For me, going to SGCC to XGCC solved all my problems.
You scared me enough, so now I think about moving to XGCC too;)

Posted: Sun Dec 09, 2007 1:54 am
by Shiru
While trying to install XGCC I remembered how much I hate GCC. It conflicts with other GCC's on machine (it even tried to compile SMD demo for Symbian) and I already don't know what to do with it;)

Fonzie, what you mean in Summer demo 2004 source file c_index.c with comment 'long:34bits'?

Posted: Sun Dec 09, 2007 3:03 am
by Shiru
How about GCC from Stef's Mini DevKit (bugs, optimization)? At least it installs easily and work fine, though it compile included example really slow and has much stuff which I don't need (because I already implemented it in my project). Seems if I choose that way, I must change init code to use it in my project..

Posted: Sun Dec 09, 2007 1:00 pm
by Fonzie
Hi shiru,
About the long : 34 bit... its just a typo... its 32bit too :)

Well, I never installed XGCC, I just put the content in c:/xgcc and put the xgcc.bat in the c:/ root and its done :)
And to compile, you first execute c:/xgcc.bat and then c:/yourproject/compile.bat (without closing the window). There is a trick to avoid those things, but I only know it for windows98, not XP, sorry).

About Stef devkit, it is similar to XGCC, but you'll need to tweak it a bit to compile exactly what you want (well, it gave me this impression).

Good luck

Fonz

Posted: Sun Dec 09, 2007 3:12 pm
by Stef
I remember i had heavy bugs with SGCC. It wasn't able to handle correctly all multiplication and division. Probably an older version though.

Posted: Mon Dec 10, 2007 8:58 am
by KanedaFr
Paul Lee fixed some of these bugs I emailed him...
I don't remember if the version of my website is the last one....

Posted: Fri Dec 14, 2007 10:59 pm
by plee
KanedaFr wrote:Paul Lee fixed some of these bugs I emailed him...
I don't remember if the version of my website is the last one....
I did fix some bugs but I would recommend going to GCC but if your not having any problems then don't switch. :D

There was a optimizer with Sozobon but I found that if you manually did the optimizing it was better so I never bothered with it.

Posted: Sat Dec 15, 2007 4:15 pm
by Shiru
plee wrote:I would recommend going to GCC but if your not having any problems then don't switch. :D
I had no problems until I moved this project to GCC recently;)