seg fault with optimisation

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
radius
Posts: 7
Joined: Fri Jul 22, 2005 9:47 pm

seg fault with optimisation

Post by radius »

Hi,
I tried to compile neocdpsp0.5 (http://yoyofr92.free.fr/psp/files/neocdpsp-0.5.src.zip), the original dev says he compiled it with svn 690, as I can't find a way to get this version, I compiled with the last psptoolchain stuff (svn 724) and I'm getting this error
with the original -O3

Code: Select all

psp-gcc  -Isrc -Isrc/psp -Isrc/zip -Isrc/zlib -Isrc/68k -Isrc/z80 -Isrc/video -Isrc/libmad -I. -I/usr/local/pspdev/psp/s
dk/include -O3 -g -fstrict-aliasing -DINLINE="static inline" -DLOWERCASEFILES -include src/psp/floatonly.h -DCPU68K_USE_
C68K -D_PSPyo_ -DZ80_EMULATED  -DSOUND -DENABLE_CDDA -DUSE_PD4990A -DUSE_MEMCARD -DFPM_MIPS -DPSP_MODE -DVIDEO_PSP -c sr
c/68k/c68k/c68kexec.c -oobj/68k/c68k/c68kexec.o
src/68k/c68k/c68kexec.c: In function 'C68k_Exec':
src/68k/c68k/c68kexec.c:268: internal compiler error: Segmentation fault
I can only get this file compiled at -O0 and it's ultra slow ^^, so I compiled everything execpt c68kexec.o with -O3 but it's still a bit slower than the original.
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

you can checkout 690 by doing a svn checkout -r 690 [url here]
Lego of my Ago!
radius
Posts: 7
Joined: Fri Jul 22, 2005 9:47 pm

Post by radius »

Agoln wrote:you can checkout 690 by doing a svn checkout -r 690 [url here]
Eheh thanks Agoln :)
radius
Posts: 7
Joined: Fri Jul 22, 2005 9:47 pm

Post by radius »

hum I downloaded 690 and done ./bootstrap; ./configure; ./make clean; ./make
I tried compiling again and i got the same, is it enought to replace the "old" one ?
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Just a note, excessive inlining (-O3) on the PSP is not a good idea. The reason is that the PSP has a tiny I-cache (16KB), so by the time you restart your inlined loop you're reloading that part into the cache anyway. I suspect C68k_Exec() is the main CPU loop, which is bigger than 16KB. I had problems in VisualBoyAdvance with a file that had tons of inlining (the compiler would run out of memory). I made a few of the heavily-used inline functions static, and it compiles that file fine now. That may work for you.

I'd recommend always using the -O2 option (or -Os) as that usually gives the right balance between size and speed. All of that -O3 inlining is only good for CPU's with large caches, such as the x86.
Post Reply