View previous topic :: View next topic |
Author |
Message |
Mux n00b
Joined: 04 Mar 2003 Posts: 9
|
Posted: Tue Mar 04, 2003 6:19 pm Post subject: gcc 3.2.2 and Pentium4 |
|
|
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 |
|
|
rajl Apprentice
Joined: 25 Sep 2002 Posts: 287
|
Posted: Tue Mar 04, 2003 6:58 pm Post subject: |
|
|
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 |
|
|
ebrostig Bodhisattva
Joined: 20 Jul 2002 Posts: 3152 Location: Orlando, Fl
|
Posted: Tue Mar 04, 2003 10:08 pm Post subject: |
|
|
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 |
|
|
LoOpYgUy n00b
Joined: 24 Sep 2002 Posts: 30
|
Posted: Wed Mar 05, 2003 4:37 pm Post subject: |
|
|
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 |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Mar 05, 2003 7:31 pm Post subject: |
|
|
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 |
|
|
MadEgg l33t
Joined: 06 Jun 2002 Posts: 678 Location: Netherlands
|
Posted: Sat Mar 08, 2003 11:03 am Post subject: |
|
|
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 |
|
|
MadEgg l33t
Joined: 06 Jun 2002 Posts: 678 Location: Netherlands
|
Posted: Sat Mar 08, 2003 11:04 am Post subject: |
|
|
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 |
|
|
rbonthond Apprentice
Joined: 24 Jun 2002 Posts: 190
|
Posted: Sat Mar 08, 2003 12:06 pm Post subject: |
|
|
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 |
|
|
Heretic Tux's lil' helper
Joined: 03 Jul 2002 Posts: 114 Location: Austin, TX USA
|
Posted: Thu Mar 20, 2003 9:43 am Post subject: |
|
|
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 |
|
|
allan_q n00b
Joined: 01 Jan 2003 Posts: 43
|
Posted: Thu Mar 20, 2003 9:11 pm Post subject: Try this |
|
|
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 |
|
|
giraff n00b
Joined: 22 Mar 2003 Posts: 18 Location: HUNGARY
|
Posted: Sat Mar 22, 2003 10:16 am Post subject: |
|
|
Greetings!
I have decided for march=pentium4 -O3 -pipe. (Shall anything terrible happen to me please feed my dog, visit my granny... )
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 |
|
|
Zadeh Tux's lil' helper
Joined: 31 Oct 2002 Posts: 131
|
Posted: Sat Mar 22, 2003 1:22 pm Post subject: |
|
|
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 |
|
|
giraff n00b
Joined: 22 Mar 2003 Posts: 18 Location: HUNGARY
|
Posted: Sat Mar 22, 2003 1:33 pm Post subject: |
|
|
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
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 |
|
|
Zadeh Tux's lil' helper
Joined: 31 Oct 2002 Posts: 131
|
Posted: Sat Mar 22, 2003 2:00 pm Post subject: |
|
|
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 |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Fri Mar 28, 2003 6:01 pm Post subject: |
|
|
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 |
|
|
Zadeh Tux's lil' helper
Joined: 31 Oct 2002 Posts: 131
|
Posted: Fri Mar 28, 2003 6:05 pm Post subject: |
|
|
Will what solve your problem? |
|
Back to top |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Fri Mar 28, 2003 6:09 pm Post subject: |
|
|
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 |
|
|
Zadeh Tux's lil' helper
Joined: 31 Oct 2002 Posts: 131
|
Posted: Fri Mar 28, 2003 6:12 pm Post subject: |
|
|
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 |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Fri Mar 28, 2003 6:42 pm Post subject: |
|
|
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 |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Sat Mar 29, 2003 4:57 pm Post subject: |
|
|
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 |
|
|
Zadeh Tux's lil' helper
Joined: 31 Oct 2002 Posts: 131
|
Posted: Sat Mar 29, 2003 5:03 pm Post subject: |
|
|
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 |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Sat Mar 29, 2003 6:05 pm Post subject: |
|
|
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 |
|
|
LJ Apprentice
Joined: 27 Dec 2002 Posts: 156
|
Posted: Sat Mar 29, 2003 8:58 pm Post subject: |
|
|
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 |
|
|
MadEgg l33t
Joined: 06 Jun 2002 Posts: 678 Location: Netherlands
|
Posted: Sun Mar 30, 2003 4:57 pm Post subject: |
|
|
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 |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Sun Mar 30, 2003 10:41 pm Post subject: |
|
|
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 |
|
|
|