Closed ryzom-pipeline closed 10 years ago
Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).
I already noticed some problems with -O3 under Android, but it was a GCC crash while compiling. Please do you know if it's a known GCC bug fixed in more recent versions ?
It could be really problematic indeed :(
Original comment by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).
gcc-4.8.1-10ubuntu9 (saucy) and compiled with -O3, multiple services are chain crashing on startup.
When compiled with -O2, everything seems to be fine.
Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).
Thanks for the investigation !
Original comment by Matt Raykowski (Bitbucket: [Matt Raykowski](https://bitbucket.org/Matt Raykowski), ).
-O3 optimization has been a problem for many years. I have no idea why, Nevrax just forced -O2 or lower.
Original comment by Matthew Lagoe (Bitbucket: botanic, GitHub: botanic).
The diference between 02 and 03 are
-fgcse-after-reload -finline-functions -fipa-cp-clone -fpredictive-commoning -ftree-loop-distribute-patterns -ftree-vectorize -funswitch-loops
I would say compile it with -O2 and then add one of the above flags till it doesnt work. Will at least tell us what flag is causing it to crash, that said i would guess its -ftree-vectorise
Original comment by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).
gcc-4.6 (ubuntu precise)
-O3 -fno-ipa-cp-clone
fixed crash on npcChat.gcc-4.8 (ubuntu saucy)
builds/runs fine with -O3 -fno-inline-functions -fno-ipa-cp-clone
builds/runs fine with -O2 -fgcse-after-reload -fpredictive-commoning -ftree-loop-distribute-patterns -ftree-vectorize -funswitch-loops
builds fine, crash on BS, MFS, SU -O2 -fgcse-after-reload -finline-functions -fpredictive-commoning -ftree-loop-distribute-patterns -ftree-vectorize -funswitch-loops
builds fine, crash on BS, MFS, SU -O2 -finline-functions -fpredictive-commoning -ftree-loop-distribute-patterns -ftree-vectorize -funswitch-loops
fails to compile with -O2 -fipa-cp-clone -fpredictive-commoning -ftree-loop-distribute-patterns -ftree-vectorize -funswitch-loops
../../../../lib/libryzom_gameshare.a(mirror.cpp.o):(.bss+0xc0): multiple definition of `MainNbEntitiesInstance'
CMakeFiles/ryzom_mirror_service.dir/mirror_service.cpp.o:(.bss+0x100): first defined here
/usr/bin/ld: Warning: size of symbol `MainNbEntitiesInstance' changed from 72 in CMakeFiles/ryzom_mirror_service.dir/mirror_service.cpp.o to 64 in ../../../../lib/libryzom_gameshare.a(mirror.cpp.o)
collect2: error: ld returned 1 exit status
Original comment by Jan Boon (Bitbucket: [Jan Boon](https://bitbucket.org/Jan Boon), ).
Committed a patch that seems to work for me, please check if this resolves the issue.
Original comment by Jan Boon (Bitbucket: [Jan Boon](https://bitbucket.org/Jan Boon), ).
If possible, can someone make the compiler output which functions declared as inline are not inlined under -O2
Original comment by Jan Boon (Bitbucket: [Jan Boon](https://bitbucket.org/Jan Boon), ).
This should be fixed now.
Original report by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).
It seems that with -O3 switch, compiler will remove some required code making IOS to crash when receiving NPC talk message
I added some debug messages and got this in log
Compiler is gcc 4.6.3-1ubuntu5
As you can see, send_chat.h line 93 does not add anything to output buffer when compiled with -O3 and making message too short for IOS to read.