SGCC vs. XGCC - speed?

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

SGCC vs. XGCC - speed?

Post by Shiru » Sat Dec 08, 2007 11:15 am

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).

Fonzie
Genny lover
Posts: 323
Joined: Tue Aug 29, 2006 11:17 am
Contact:

Post by Fonzie » Sat Dec 08, 2007 3:10 pm

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.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sat Dec 08, 2007 10:55 pm

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.

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Dec 09, 2007 12:07 am

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?

Fonzie
Genny lover
Posts: 323
Joined: Tue Aug 29, 2006 11:17 am
Contact:

Post by Fonzie » Sun Dec 09, 2007 12:20 am

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!

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Dec 09, 2007 12:31 am

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.

Fonzie
Genny lover
Posts: 323
Joined: Tue Aug 29, 2006 11:17 am
Contact:

Post by Fonzie » Sun Dec 09, 2007 12:40 am

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.

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Dec 09, 2007 12:47 am

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;)

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Dec 09, 2007 1:54 am

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'?

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Dec 09, 2007 3:03 am

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..

Fonzie
Genny lover
Posts: 323
Joined: Tue Aug 29, 2006 11:17 am
Contact:

Post by Fonzie » Sun Dec 09, 2007 1:00 pm

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

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sun Dec 09, 2007 3:12 pm

I remember i had heavy bugs with SGCC. It wasn't able to handle correctly all multiplication and division. Probably an older version though.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Mon Dec 10, 2007 8:58 am

Paul Lee fixed some of these bugs I emailed him...
I don't remember if the version of my website is the last one....

plee
Very interested
Posts: 66
Joined: Wed Nov 29, 2006 11:32 am
Location: Houston, Texas

Post by plee » Fri Dec 14, 2007 10:59 pm

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.

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sat Dec 15, 2007 4:15 pm

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;)

Post Reply