Bug 65327 - ocaml-3.08.1 fails with -O3 on gcc 3.4
Bug#: 65327 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: CLOSED Severity: normal Priority: P3
Resolution: FIXED Assigned To: ml@gentoo.org Reported By: liquidx@gentoo.org
Component: Applications
URL: 
Summary: ocaml-3.08.1 fails with -O3 on gcc 3.4
Keywords:  
Status Whiteboard: 
Opened: 2004-09-25 08:55 0000
Description:   Opened: 2004-09-25 08:55 0000
make[1]: Entering directory
`/var/tmp/portage/ocaml-3.08.1/work/ocaml-3.08.1/otherlibs/num'
gcc -O -I../../byterun -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
-march=pentium3 -O3 -pipe -fno-stack-protector -fPIC -DBNG_ARCH_ia32
-DBNG_ASM_LEVEL=2   -c -o bng.o bng.c
bng_ia32.c: In function `bng_ia32_mult_add_digit':
bng_ia32.c:111: error: can't find a register in class `GENERAL_REGS' while
reloading `asm'
make[1]: *** [bng.o] Error 1
make[1]: Leaving directory
`/var/tmp/portage/ocaml-3.08.1/work/ocaml-3.08.1/otherlibs/num'
make: *** [otherlibraries] Error 2 

similar problem to here: 

http://forums.gentoo.org/viewtopic.php?p=1579854#1579854

other apps are also experiencing this to varying degree:
http://lists.gnu.org/archive/html/qemu-devel/2004-07/msg00433.html

I added a replace-flags -O3 -O2 to the ebuild locally, but i suspect there
isn't much to be done except to be aware of the problem if we are using gcc 3.4

------- Comment #1 From Matthieu Sozeau (RETIRED) 2004-09-27 12:50:15 0000 -------
Exactly, the code is already hand-tuned to get the most of x86's reduced
register space. I don't see the flag handling in the ebuild actually, you can
commit it.

------- Comment #2 From Thomas Weidner 2004-10-11 11:55:10 0000 -------
i still have this problem,the ebuild also has no replace-flags....

------- Comment #3 From Matthieu Sozeau (RETIRED) 2004-10-11 13:43:54 0000 -------
It should have, i'll add it tomorrow, in the mean time you can build with
CFLAGS="".

------- Comment #4 From Matthieu Sozeau (RETIRED) 2004-10-12 12:37:39 0000 -------
I added strip-flags which removes -O3 and other quite untested flags.

------- Comment #5 From Carsten Tschense 2004-10-20 10:07:29 0000 -------
"strip-flags" doesn't remove -O3. Still the same ;)
Use "replace-flags -O? -O2"

------- Comment #6 From Matthieu Sozeau (RETIRED) 2004-10-20 11:04:20 0000 -------
I fixed that in CVS, now closing the bug :)