Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gcc 3.2.2 and Pentium4
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Mux
n00b
n00b


Joined: 04 Mar 2003
Posts: 9

PostPosted: Tue Mar 04, 2003 6:19 pm    Post subject: gcc 3.2.2 and Pentium4 Reply with quote

Hi,

I have read the threads about the problem with gcc 3.2.2 but I didn't found an answer to this question:

I have compiled quite alot of my system with gcc 3.2.2 and used the march=pentium4 option. My systems seems fine, but is is bad under the shell because of this?

Or is this a problem that only a few has?

Thanks alot!
Back to top
View user's profile Send private message
rajl
Apprentice
Apprentice


Joined: 25 Sep 2002
Posts: 287

PostPosted: Tue Mar 04, 2003 6:58 pm    Post subject: Reply with quote

I asked about the same problem here in the forum, and no one seemed to provide me a straigt answer. I've gone ahead and compiled anyway with march=pentium4 and have had no problems with stability, etc. I have a feeling that it's a problem that only shows up in poorly written/maintained code. THat's just my two cents.
_________________
-Rajl

-----------------------------------------------------------
It's easy to be brave once you consider the alternatives.
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Mar 04, 2003 10:08 pm    Post subject: Reply with quote

As long as your CPU is a Pentium 4, you are fine.

There have been several issues where an overly aggressive CFLAGS setting has caused problems.

Personally I use the following CFLAGS:

CFLAGS="-march=pentium4 -O2 -pipe -fPIC -ffast-math"

And it seems to be working fine.

Today I stumbled over Optimizing GCC which has tested various optimizer settings for compiling GCC itself. I haven't had time to test it yet myself.
Another article worth reading is GCC Myths and Facts

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
LoOpYgUy
n00b
n00b


Joined: 24 Sep 2002
Posts: 30

PostPosted: Wed Mar 05, 2003 4:37 pm    Post subject: Reply with quote

I have actually had a problem when I changed from pentium4 to pentium3. I couldn't get evolution to compile with that flag. I then changed it back to pentuim4 and it works perfectly. The program compiled fine, and runs fine as well.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Mar 05, 2003 7:31 pm    Post subject: Reply with quote

The problem with -march=pentium4 I am aware of consists of incorrect code being generated for floating-point conversion functions. Try the following:
Code:
$ python -c 'int(10.1); int(10000.3); int(1.2)'

_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
MadEgg
l33t
l33t


Joined: 06 Jun 2002
Posts: 678
Location: Netherlands

PostPosted: Sat Mar 08, 2003 11:03 am    Post subject: Reply with quote

I've got that same problem here.

Obeysive to that message, I changed Pentium4 to Pentium3. I couldn't get a lot to compile anymore, binutils, icewm, gnome-vfs among others.

I always got errors about the assambler instructions not being correct.

I changed it back to Pentium4 and it all works like a charm.
_________________
Pentium 4 Prescott 3,2 GHz
Asus P4P800 SE, i865PE chipset
1024 MB PC3200 RAM
AOpen Aeolus GeForce 6800 Ultra 256 MB DDR2
Creative Audigy2 ZS
gentoo-sources-2.6.20-r7
nVidia-drivers version 9755
Back to top
View user's profile Send private message
MadEgg
l33t
l33t


Joined: 06 Jun 2002
Posts: 678
Location: Netherlands

PostPosted: Sat Mar 08, 2003 11:04 am    Post subject: Reply with quote

rac wrote:
The problem with -march=pentium4 I am aware of consists of incorrect code being generated for floating-point conversion functions. Try the following:
Code:
$ python -c 'int(10.1); int(10000.3); int(1.2)'


When I do that I get:

Traceback (most recent call last):
File "<string>", line 1, in ?
OverflowError: float too large to convert
_________________
Pentium 4 Prescott 3,2 GHz
Asus P4P800 SE, i865PE chipset
1024 MB PC3200 RAM
AOpen Aeolus GeForce 6800 Ultra 256 MB DDR2
Creative Audigy2 ZS
gentoo-sources-2.6.20-r7
nVidia-drivers version 9755
Back to top
View user's profile Send private message
rbonthond
Apprentice
Apprentice


Joined: 24 Jun 2002
Posts: 190

PostPosted: Sat Mar 08, 2003 12:06 pm    Post subject: Reply with quote

MadEgg wrote:
rac wrote:
The problem with -march=pentium4 I am aware of consists of incorrect code being generated for floating-point conversion functions. Try the following:
Code:
$ python -c 'int(10.1); int(10000.3); int(1.2)'


When I do that I get:

Traceback (most recent call last):
File "<string>", line 1, in ?
OverflowError: float too large to convert



same here

Code:

Portage 2.0.47-r8 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r2)
=================================================================
System uname: 2.4.19-gentoo-r10 i686 Intel(R) Pentium(R) 4 CPU 2.53GHz
USE="x86 oss 3dnow avi crypt cups encode gif jpeg libg++ mikmod mmx mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib gdbm berkdb slang readline arts svga tcltk java X sdl gpm tcpd pam ssl python esd imlib oggvorbis gtk qt kde motif opengl mozilla aalib alsa apache2 -apm cdr dvd flash -gnome gphoto2 gtk2 -libwww perl sse tiff usb"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
Back to top
View user's profile Send private message
Heretic
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2002
Posts: 114
Location: Austin, TX USA

PostPosted: Thu Mar 20, 2003 9:43 am    Post subject: Reply with quote

rac wrote:
The problem with -march=pentium4 I am aware of consists of incorrect code being generated for floating-point conversion functions. Try the following:
Code:
$ python -c 'int(10.1); int(10000.3); int(1.2)'


Holy crap. Yup, python -c 'int(10000.3)' gives me the same overflow error on a P4. WTF? When's that gonna get fixed? The code runs fine on my P3.
Back to top
View user's profile Send private message
allan_q
n00b
n00b


Joined: 01 Jan 2003
Posts: 43

PostPosted: Thu Mar 20, 2003 9:11 pm    Post subject: Try this Reply with quote

Try changing your CFLAGS from "-march=pentium4 ... " to "-mcpu=pentium4 ... " and re-emerge glibc and python. Change the CFLAGS back when you're done. I vaguely remember this as a solution. It seems that certain versions of GCC has trouble compiling glibc on P4s.

Hope this helps but YMMV.
_________________
* SLMR 2.1a * This tagline is umop apisdn
"We don't get offered crises, they arrive." - Elizabeth Janeway
Back to top
View user's profile Send private message
giraff
n00b
n00b


Joined: 22 Mar 2003
Posts: 18
Location: HUNGARY

PostPosted: Sat Mar 22, 2003 10:16 am    Post subject: Reply with quote

Greetings!

I have decided for march=pentium4 -O3 -pipe. (Shall anything terrible happen to me please feed my dog, visit my granny... :D )

However as I look at the infos while compiling, the section '-march=pentium3 -O3 -pipe' comes up over&over. Is there some kind of built-in routine to decrease p4 to p3 regardless what has been written to make.conf?

giraff
Back to top
View user's profile Send private message
Zadeh
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 131

PostPosted: Sat Mar 22, 2003 1:22 pm    Post subject: Reply with quote

There are known codegen problems with SSE2 insns that are enabled when you use -march=pentium4 (equivalent to: -mcpu=pentium4 -msse2).

I've noticed some ebuilds rewrite your C[XX]FLAGS if -march=pentium4 is detected to -march=pentium3. -mcpu=pentium4 works fine though, and comments floating around in e.g. /etc/make.conf about it and switching to -march/-mcpu=pentium3 in ebuilds are just plain wrong.
Back to top
View user's profile Send private message
giraff
n00b
n00b


Joined: 22 Mar 2003
Posts: 18
Location: HUNGARY

PostPosted: Sat Mar 22, 2003 1:33 pm    Post subject: Reply with quote

Quote:
mcpu=pentium4 works fine though, and comments floating around in e.g. /etc/make.conf about it and switching to -march/-mcpu=pentium3 in ebuilds are just plain wrong


hm :roll:

Is this some kind of feeling, experience, or you have read it swhere? May you have any informative links please paste them! Hope it really works, don't want to install gentoo for the 3rd time, takesawhile... :|
Back to top
View user's profile Send private message
Zadeh
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 131

PostPosted: Sat Mar 22, 2003 2:00 pm    Post subject: Reply with quote

Just look at the GNATS bug database on gcc.gnu.org and search for "pentium4" or "sse" or look at all the wrong-code class of bugs. There are several open ones concerning -march=pentium4. I've ran into a few of them. I'd imagine they'll be fixed for 3.3 but maybe not 3.2.3.
Back to top
View user's profile Send private message
chatgris
Guru
Guru


Joined: 14 Oct 2002
Posts: 383
Location: Canada

PostPosted: Fri Mar 28, 2003 6:01 pm    Post subject: Reply with quote

I have currently been bitten by this bug... I am trying to compile gentoo from scratch with

CFLAGS="mcpu=i686 -O2 -pipe"

Will this solve the problem?

Josh.
_________________
Open your mind. Open your source.

Due credit for avatar from http://www.aikida.net
Back to top
View user's profile Send private message
Zadeh
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 131

PostPosted: Fri Mar 28, 2003 6:05 pm    Post subject: Reply with quote

Will what solve your problem?
Back to top
View user's profile Send private message
chatgris
Guru
Guru


Joined: 14 Oct 2002
Posts: 383
Location: Canada

PostPosted: Fri Mar 28, 2003 6:09 pm    Post subject: Reply with quote

Recompiling everything with mcpu=i686 or march=i686 instead of march=pentium4.

I'm having the problem where in php sprintf( "%.2f", 10.75 );

is returning 0.00

but on my athlon it works as expected.

Josh.
_________________
Open your mind. Open your source.

Due credit for avatar from http://www.aikida.net
Back to top
View user's profile Send private message
Zadeh
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 131

PostPosted: Fri Mar 28, 2003 6:12 pm    Post subject: Reply with quote

Probably. -mcpu=pentium4 should also work, which is a better choice. If that works, you might also want to go file a bug report for that particular ebuild so the -march setting can be filtered.
Back to top
View user's profile Send private message
chatgris
Guru
Guru


Joined: 14 Oct 2002
Posts: 383
Location: Canada

PostPosted: Fri Mar 28, 2003 6:42 pm    Post subject: Reply with quote

Sure, I'll try that, I don't mind being a guinea pig here :)
_________________
Open your mind. Open your source.

Due credit for avatar from http://www.aikida.net
Back to top
View user's profile Send private message
chatgris
Guru
Guru


Joined: 14 Oct 2002
Posts: 383
Location: Canada

PostPosted: Sat Mar 29, 2003 4:57 pm    Post subject: Reply with quote

Hmm... I jsut noticed that make.conf says...


Quote:
PENITUM4 will generate invalid instructions; use 'penitum3' instead.



Now I'm using mcpu=pentium4 NOT march...

Also, that comment doesn't say whether or not you should use -march=pentium3 or mcpu=pentium3..

will march=pentium3 work on a pentium4?

Josh.
_________________
Open your mind. Open your source.

Due credit for avatar from http://www.aikida.net
Back to top
View user's profile Send private message
Zadeh
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 131

PostPosted: Sat Mar 29, 2003 5:03 pm    Post subject: Reply with quote

Those comments in make.conf are misleading. Using -march/mcpu = pentium3 will work fine for a p4 since there aren't any instructions a p3 has that a p4 doesn't. However, the instructions will be 'scheduled' differently and not as optimally as if you used -mcpu=pentium4.

Anyway there probably won't be any user-visible differences except for a few cpu-intensive applications.
Back to top
View user's profile Send private message
chatgris
Guru
Guru


Joined: 14 Oct 2002
Posts: 383
Location: Canada

PostPosted: Sat Mar 29, 2003 6:05 pm    Post subject: Reply with quote

I have compiled my entire system with mcpu=pentium4 and now floating point numbers work!

Josh
_________________
Open your mind. Open your source.

Due credit for avatar from http://www.aikida.net
Back to top
View user's profile Send private message
LJ
Apprentice
Apprentice


Joined: 27 Dec 2002
Posts: 156

PostPosted: Sat Mar 29, 2003 8:58 pm    Post subject: Reply with quote

I've experienced quite a few problems with -march=pentium4 that i didn't experience with -mcpu=pentium4. Python was just one of them, but there were a few others.
Back to top
View user's profile Send private message
MadEgg
l33t
l33t


Joined: 06 Jun 2002
Posts: 678
Location: Netherlands

PostPosted: Sun Mar 30, 2003 4:57 pm    Post subject: Reply with quote

Can you give me some examples?

I haven't noticed anything that bothers me so far. I never use python anyway.
_________________
Pentium 4 Prescott 3,2 GHz
Asus P4P800 SE, i865PE chipset
1024 MB PC3200 RAM
AOpen Aeolus GeForce 6800 Ultra 256 MB DDR2
Creative Audigy2 ZS
gentoo-sources-2.6.20-r7
nVidia-drivers version 9755
Back to top
View user's profile Send private message
chatgris
Guru
Guru


Joined: 14 Oct 2002
Posts: 383
Location: Canada

PostPosted: Sun Mar 30, 2003 10:41 pm    Post subject: Reply with quote

emerge php, and then try

Code:
<?php printf( "%.2f", 10.75 ); ?>

_________________
Open your mind. Open your source.

Due credit for avatar from http://www.aikida.net
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
Goto page 1, 2  Next
Page 1 of 2

 
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