Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unstable binaries due to GCC optimizations?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
rachaef
n00b
n00b


Joined: 19 Apr 2002
Posts: 39
Location: Vienna/Austria/Europe

PostPosted: Sun Apr 21, 2002 2:43 pm    Post subject: Unstable binaries due to GCC optimizations? Reply with quote

Hey all

First of all - Gentoo developers: great job! You made me leave Debian, which will happen as soon as I am able to solve the problems below. Gentoo's concept is much nearer to perfection than what I've ever seen on my trip through the world of Linux distributions :) I've never had this feeling of knowing what's going on and being in control...btw, what happened to that "Larry the cow" poster? I can't find it anymore.

I've installed Gentoo 1.1a from the stage 3 image on the boot cd and compiled everything else (X, KDE, Mozilla, Evolution and some smaller apps) with the default CFLAGS="-march=i686 -O3 -pipe". Now some apps are quite unstable - Konqueror crashes almost every time I enter a URL in the location field, the GNOME panel crashes quite often too. I'm currently running KDE 3.0, which generally works quite well, yet the Konqueror and GNOME panel probs make me think, that something went quite wrong during the compilation... :?

Could it be that the -O3 option streamlined the code too much and made the GCC produce unstable binaries? Another possible reason I've been thinking of is the USE=" [...] sse [...]" flag (as I only have a Pentium II, which AFAIK doesn't support SSE), which was set during the compilation of the whole system. Any ideas what might have gone wrong? I hope to be able to get a stable system next time, as I intend to reinstall everything from stage 1 with -O2 and USE="[...] -sse [...]".

Any help will be appreciated
rachaef
Back to top
View user's profile Send private message
daos
n00b
n00b


Joined: 18 Apr 2002
Posts: 50
Location: Virginia, USA

PostPosted: Sun Apr 21, 2002 3:16 pm    Post subject: Reply with quote

I also emerged from the stage3 image, but before I do. I made change to the make.conf and make.conf.build to use O2 optimization instead of O3.
My system seems very stable, no problem so far.
I also made comparison of file size between O2 and O3, almost the same (e.g compiling bash).
Back to top
View user's profile Send private message
daos
n00b
n00b


Joined: 18 Apr 2002
Posts: 50
Location: Virginia, USA

PostPosted: Sun Apr 21, 2002 3:24 pm    Post subject: Reply with quote

I also noticed that every time you "emerge rsync". the change you made to USE is gone (make.defaults). Be sure to update before compiling apps again.
Back to top
View user's profile Send private message
rachaef
n00b
n00b


Joined: 19 Apr 2002
Posts: 39
Location: Vienna/Austria/Europe

PostPosted: Sun Apr 21, 2002 3:37 pm    Post subject: Reply with quote

daos wrote:
I also emerged from the stage3 image, but before I do. I made change to the make.conf and make.conf.build to use O2 optimization instead of O3.
My system seems very stable, no problem so far.
I also made comparison of file size between O2 and O3, almost the same (e.g compiling bash).


If that is so, it might just be a good idea to change the default CFLAGS setting in make.conf to -O2...Anyone else having experience with the matter?

daos wrote:
I also noticed that every time you "emerge rsync". the change you made to USE is gone (make.defaults). Be sure to update before compiling apps again.


Yeah, /etc/make.profile/make.defaults is part of the portage tree (symlink make.profile -> ../usr/portage/profiles/default-1.0/), it's better to use /etc/make.conf to set a custom USE variable.

Thanks, it looks like I'll give it a try in two weeks, as soon as I've graduated from high school :)
Back to top
View user's profile Send private message
lk42pro
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2002
Posts: 114
Location: New Jersey, USA

PostPosted: Sun Apr 21, 2002 4:44 pm    Post subject: Its fine for me Reply with quote

I have athlon XP 1600, 512 pc2100 ddr ram and ati radeon 8500...i downloaded the i686 image bootcd and started from step 3...i didn't change anything in the makeflag ...default is at o3....so far everything is smooth and stable..i am using kde3 and xfree86 4.2...
Back to top
View user's profile Send private message
rachaef
n00b
n00b


Joined: 19 Apr 2002
Posts: 39
Location: Vienna/Austria/Europe

PostPosted: Sun Apr 21, 2002 4:55 pm    Post subject: Reply with quote

Well, I doubt it, but is there a chance of a Pentium II screwing up things, where an Athlon XP does just fine?
Back to top
View user's profile Send private message
Guest






PostPosted: Sun Apr 21, 2002 5:12 pm    Post subject: Reply with quote

I've used the -O3 GCC option to compile everything using a stage1 Gentoo 1.0 install CD, and I'm not having any stability issues at all so far (been running fine since 1.0 was released, and using 1.0_r6 with the same optimisations up 'til then). My two friends, using nearly the exact same system spec have also used the optimisation levels with no noticeable stability problems. We are all running Athlon TBs.

Are you using GCC 2 or GCC 3, as GCC 3 has trouble compiling certain programs due to it's stricter adherence to the ISO C/C++ standards than GCC 2. It's all I can think of, apart from the SSE which may not be supported on your processor.

Dave
Back to top
hbbio
n00b
n00b


Joined: 21 Apr 2002
Posts: 38
Location: Paris, France

PostPosted: Sun Apr 21, 2002 5:26 pm    Post subject: Reply with quote

rachaef wrote:
Well, I doubt it, but is there a chance of a Pentium II screwing up things, where an Athlon XP does just fine?


On a 2 x PII (Xeon) 450 Mhz; 256 Mb ECC SDRAM 100 MHz; AIC-7880- Seagate Cheetah 9Gb (HP Kayak XW, cheap on ebay and unbreakable).
All compiled in O3, xfs main filesystem.
Everything (wmaker / kde / mozilla / gnome office / ...) runs perfectly well and fast.
Back to top
View user's profile Send private message
rachaef
n00b
n00b


Joined: 19 Apr 2002
Posts: 39
Location: Vienna/Austria/Europe

PostPosted: Sun Apr 21, 2002 5:57 pm    Post subject: Reply with quote

I'm using GCC 2.95.3 and it seems I'm not the only one with the problem, considering the "Konqueror highly unstable" thread in the Desktop Environment forum. I thought mine is a more general problem, but this isn't necessarily the case, so let's just move the discussion to the thread mentioned above. Thanks for the help!

rachaef
Back to top
View user's profile Send private message
chadh
Moderator
Moderator


Joined: 21 Apr 2002
Posts: 137
Location: Atlanta, GA

PostPosted: Sun Apr 21, 2002 8:02 pm    Post subject: Reply with quote

daos wrote:
I also noticed that every time you "emerge rsync". the change you made to USE is gone (make.defaults). Be sure to update before compiling apps again.


Actually, you should not need to edit make.defaults unless you are creating your own profile, in which case you should create a new profile (i.e., copy /usr/portage/profiles/default-1.0 /usr/portage/profiles/my_profile . Then it won't get overwritten. In general, it is sufficient to edit /etc/make.conf and put all your changes there.
_________________
Chad
Back to top
View user's profile Send private message
justus
n00b
n00b


Joined: 16 Apr 2002
Posts: 48

PostPosted: Sun Apr 21, 2002 9:16 pm    Post subject: Optimizations don't bother me here... Reply with quote

I currently have everything compiled with the following optimizations:

Code:
CHOST="i686-pc-linux-gnu"
CFLAGS="-mcpu=i686 -O3 -pipe -fomit-frame-pointer -funroll-loops -fforce-addr -frerun-cse-after-loop -frerun-loop-opt -malign-functions=4"
CXXFLAGS="-mcpu=i686 -O3 -pipe -fomit-frame-pointer -funroll-loops -fforce-addr -frerun-cse-after-loop -frerun-loop-opt -malign-functions=4"


I haven't had any instability or random crashes. Actually my system is almost 100% stable (except when I break something :)

But then again that's my system. It may not work so good on someone elses... who knows...

Just my 2¢...

Justin T
Back to top
View user's profile Send private message
rachaef
n00b
n00b


Joined: 19 Apr 2002
Posts: 39
Location: Vienna/Austria/Europe

PostPosted: Sun Apr 21, 2002 10:00 pm    Post subject: Re: Optimizations don't bother me here... Reply with quote

justus wrote:
I currently have everything compiled with the following optimizations:

Code:
CHOST="i686-pc-linux-gnu"
CFLAGS="-mcpu=i686 -O3 -pipe -fomit-frame-pointer -funroll-loops -fforce-addr -frerun-cse-after-loop -frerun-loop-opt -malign-functions=4"
CXXFLAGS="-mcpu=i686 -O3 -pipe -fomit-frame-pointer -funroll-loops -fforce-addr -frerun-cse-after-loop -frerun-loop-opt -malign-functions=4"



Is there any reason why you're using -mcpu instead of -march? I guess -march is supposed to provide better optimization if you don't plan on using the system on a <686 CPU. btw, what CPU have you got?
Back to top
View user's profile Send private message
justus
n00b
n00b


Joined: 16 Apr 2002
Posts: 48

PostPosted: Sun Apr 21, 2002 10:25 pm    Post subject: Re: Optimizations don't bother me here... Reply with quote

rachaef wrote:

Is there any reason why you're using -mcpu instead of -march? I guess -march is supposed to provide better optimization if you don't plan on using the system on a <686 CPU. btw, what CPU have you got?


:oops:

You know... I really couldn't tell you why... I just looked at my make.conf and I have a listing for high, medium, and low optimizing (some require a less optimized compilation) and noticed that I have it mixed through there....I usually uncomment the one that I plan on using...

Then again that could be why everything has been so stable (and seemed slower lately...)

Oh well... I can just let it run all night again when I go to sleep here in a few minutes...

Hmmm... Thanks :wink:

Well I guess tomorrow I can tell if it's still stable and everything... after it's all compiled again :)

Justin T
Back to top
View user's profile Send private message
Guest






PostPosted: Sun Apr 21, 2002 10:41 pm    Post subject: Reply with quote

No problem :)
My guess is everything will remain as stable as it is...the Konqueror probs seem to be caused by QT incompatibilities rather than extreme optimization. Tommorow I'll try to recompile KDE and see if things get better.
Back to top
rachaef
n00b
n00b


Joined: 19 Apr 2002
Posts: 39
Location: Vienna/Austria/Europe

PostPosted: Sun Apr 21, 2002 10:42 pm    Post subject: Reply with quote

Not that it really matters, but that guest up there above this post is me :wink:
Back to top
View user's profile Send private message
justus
n00b
n00b


Joined: 16 Apr 2002
Posts: 48

PostPosted: Mon Apr 22, 2002 8:04 pm    Post subject: It works... and stable... Reply with quote

Well I recompiled and it works and it is stable still :) I also added some extras and if they continue working I may post them here to see what other people think.

The speed is a little more noticeable... one of these days though I really have to test it with a timer. It could be that it works the same and the speed difference is only based on my impatience or patience... :)

Justin T
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum