Hacker News new | past | comments | ask | show | jobs | submit login

There’s really no need to pass -O9 to GCC. Anything over -O3 should become -O3 anyways.



In older times (around the GCC 2.7 series, I think), "-O9" was documented to be the "future-proof" setting that selects the maximum optimization level, whatever it is. In practice, GCC never defined anything beyond -O3, but I still use -O9 when I want to make GCC do its best (or worst). Call it force of habit from a lengthening experience. (With Clang I use -O3 because if I write -O9 it screams at me.)

(Note that -O3 is usually not that good an idea: aggressive loop unrolling can sometimes decrease performance because of cache issues, for instance. To optimize code properly, you have to make benchmarks and adjust both the code and compiler flags accordingly, in a well-thought feedback cycle. The use of aggressive optimizations in the blog post is to make the examples trip UB more clearly.)


It doesn't hurt.


It puts the article in a different light. Makes you wonder what else he is incompetent or negligent about. In this sense it does hurt: it hurts him, it makes him less credible.


you realize who the author of the article is do you?


What are you trying to say? That because he is an authority figure to you and perhaps to other people, it is somehow OK to be ignorant about certain things? Last time I did something similar it was due to sheer ignorance and placebo. It might be a bad mistake, or a terrible habit, but it is what it is. It is silly regardless of who it comes from. :)


He is competent, and he wrote a blogpost to share something he knows on the web. It's a bit goofy to start claiming things about a character you don't know from a free publication.


Let me repeat: it is silly regardless of who it comes from. Everything else is irrelevant. You appear to be biased to the point of completely ignoring everything I have said. I get it, you like him. It does not change anything.

I merely suggested the possibility that he might be negligent or wrong about other relevant things. Do you think that this is impossible?


The author is competent and not at all silly. And the author explicitly stated what -O9 does and why he used it.

> You appear to be biased to the point of completely ignoring everything I have said.

This is in violation of you usage agreement with ycombinator.

> I merely suggested the possibility that he might be negligent or wrong about other relevant things.

No, that's not true.

> Do you think that this is impossible?

Strawman.

I see that you created your account just a few days ago ... you might want to be careful with it. In any case, I won't be engaging with you further, and I doubt that I'm the only one.


> This is in violation of you usage agreement with ycombinator.

I do not see how it would be the case.

> No, that's not true.

Care to elaborate as to why you think that it is impossible for him to be negligent or wrong?

> I see that you created your account just a few days ago

What does it have to do with anything?

> you might want to be careful with it

Are you threatening me?

> I won't be engaging with you

Okay.

> I doubt that I'm the only one

Perhaps.


I wonder if it does anything useful at all, since it -O9 is not defined, unless the compiler is some kind of special version.


IIRC, the code is actually `if O>2` or so; 3 and up are literally identical.

EDIT: Per https://wiki.gentoo.org/wiki/GCC_optimization#What_about_-O_... it's `enabled = (level >= 3);`




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: