[gentoo-user] -Os = Nono? (was: gcc 4.2 and Core 2 Duo)
Volker Armin Hemmann [EMAIL PROTECTED] wrote: And then Os. That is a big nono. Why's that? Alexander Skwar -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] -Os = Nono? (was: gcc 4.2 and Core 2 Duo)
On Montag, 23. Juli 2007, Alexander Skwar wrote: Volker Armin Hemmann [EMAIL PROTECTED] wrote: And then Os. That is a big nono. Why's that? Alexander Skwar because several gcc have compiled crap with that flag in the past? -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] -Os = Nono?
Volker Armin Hemmann wrote: On Montag, 23. Juli 2007, Alexander Skwar wrote: Volker Armin Hemmann [EMAIL PROTECTED] wrote: And then Os. That is a big nono. Why's that? Alexander Skwar because several gcc have compiled crap with that flag in the past? That was the past, -Os generally works fine on AMD64 now. That can be evidenced by my fully -Os built system that works fine. -- Kenneth Prugh - Ken69267 Gentoo AMD64 Arch Tester signature.asc Description: OpenPGP digital signature
Re: [gentoo-user] -Os = Nono?
Kenneth Prugh wrote: Volker Armin Hemmann wrote: On Montag, 23. Juli 2007, Alexander Skwar wrote: Volker Armin Hemmann [EMAIL PROTECTED] wrote: And then Os. That is a big nono. Why's that? Alexander Skwar because several gcc have compiled crap with that flag in the past? That was the past, -Os generally works fine on AMD64 now. That can be evidenced by my fully -Os built system that works fine. From my experience, the main problem with -Os is that it's rarely used, and not all that useful. It's essentially the same as -O2 with some optimizations turned off, to save space. The difference in binary size between -O2 and -Os has no, in my experience, been very significant. And -Os produces slower code than -O2. More importantly, -O2 seems to be the typical optimization setting, and almost all free software packages are built and tested and generally supported, for whatever that means in an open-source world, under -O2. If you report a bug in a package and you use -Os, the first thing the devs will ask is recompile it using normal CFLAGS and try again. So yes, recent gcc versions have been much better at not breaking code under -Os. At least, it's no more broken under -Os than under -O2. But given that disk space is dirt cheap and modern OS don't need to read an entire binary into memory to execute it, the actual, tangible benefits of using -Os over -O2 are minimal compared against the possible problems it might cause. --Mike -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] -Os = Nono?
Mike Edenfield wrote: More importantly, -O2 seems to be the typical optimization setting, and almost all free software packages are built and tested and generally supported, for whatever that means in an open-source world, under -O2. If you report a bug in a package and you use -Os, the first thing the devs will ask is recompile it using normal CFLAGS and try again. Although I agree with your reasoning above, you are contradicting yourself in the following two statements: At least, it's no more broken under -Os than under -O2. [...] benefits of using -Os over -O2 are minimal compared against the possible problems it might cause. If -Os is no more broken than -O2, then it shouldn't cause any extra problems. :) But given that disk space is dirt cheap It's not about disk space, it's about the amount that needs to be loaded from disk upon first run. and modern OS don't need to read an entire binary into memory to execute it, But if the entire binary is larger, each coherent subsection will be larger too, so more will have to be loaded with -O2 than with -Os. Processors are fast enough and getting faster all the time, it is only those disks that don't get any quicker -- not until we drop all those spinning platters and go solid state. Benno -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] -Os = Nono?
Hi, Have you actually measured the gain? Emerge some thing with Os, qsize the package, emerge it with O2, qsize again? I went back to O2 from Os when it became apparent that the resulting binaries were actually _larger_. On every single package I tried. Zsitvai János -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] -Os = Nono?
Benno Schulenberg wrote: Although I agree with your reasoning above, you are contradicting yourself in the following two statements: At least, it's no more broken under -Os than under -O2. [...] benefits of using -Os over -O2 are minimal compared against the possible problems it might cause. If -Os is no more broken than -O2, then it shouldn't cause any extra problems. :) True, this is a contradiction, but only in the sense that I failed to distinguish between the general case of most things that used to break under -Os don't break anymore, vs. the specific cases where the two settings actually do differ. Obviously, O2 and Os are using a different set of optimizations. In most cases the code is the same, so if there's a problem with the resulting code, it's probably not the compiler's fault. But there are always going to be corner cases where some extra space-saving optimization does something unintended, or exposes some bug, that O2 does not. --K -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] -Os = Nono?
On Montag, 23. Juli 2007, Kenneth Prugh wrote: Volker Armin Hemmann wrote: On Montag, 23. Juli 2007, Alexander Skwar wrote: Volker Armin Hemmann [EMAIL PROTECTED] wrote: And then Os. That is a big nono. Why's that? Alexander Skwar because several gcc have compiled crap with that flag in the past? That was the past, -Os generally works fine on AMD64 now. That can be evidenced by my fully -Os built system that works fine. no, it does not 'works fine'. a) grep -R Os /usr/portage and have an unpleasant surprise. b) I compiled a couple of stuff with Os and the result: picture resizing and browsing with kuickshow and gwenview was a lot slower. The only thing I compile with Os is the kernel - after I played a lot of ut2004 to make sure that it is not slower... -- [EMAIL PROTECTED] mailing list