How well do you know GCC's optimizer?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

How well do you know GCC's optimizer?

Post by Falco Girgis »

You owe it to yourselves to go here and take the quiz! Awesome!

http://ridiculousfish.com/blog/archives ... -optimize/
K-Bal
ES Beta Backer
ES Beta Backer
Posts: 701
Joined: Sun Mar 15, 2009 3:21 pm
Location: Germany, Aachen
Contact:

Re: How well do you know GCC's optimizer?

Post by K-Bal »

Nice one, very informative.
User avatar
ismetteren
Chaos Rift Junior
Chaos Rift Junior
Posts: 276
Joined: Mon Jul 21, 2008 4:13 pm

Re: How well do you know GCC's optimizer?

Post by ismetteren »

Click here to see the hidden message (It might contain spoilers)
I was wrong on the first one. The reason i answered that it wouldn't optimize, was because i am learning scala, which can't optimize non-tail-recursive recursive functions, even though it is a functional language, so i thought that it was very hard if not impossible to do.
Now that i think about it, i think i read somewhere that the reason scala couldn't do it, was that it was limited by the JVM, not sure though.

The rest of the questions i just answered yes to, since i have heard about all sorts of crazy ways compilers can optimize code in. It proved to be a good tactic, since it was right on all but one.

but no, i don't really have a clue about what GCC can optimize and what it cant :P
Image ImageImage Image
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: How well do you know GCC's optimizer?

Post by MrDeathNote »

Nice, i only got one wrong but i guessed most as i'm not that familiar with GCC but it's pretty sweet none the less.
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: How well do you know GCC's optimizer?

Post by dandymcgee »

A lot of guessing here as well, but I did learn a few things. :)
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
Post Reply