[fixed]Redundant compiler switches

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

[fixed]Redundant compiler switches

Post by randomMesh »

When compiling Irrlicht with GCC in release mode (NDEBUG=1), there are the following switches to GCC:

Code: Select all

-fstrict-aliasing -fexpensive-optimizations -O3
You can reduce this to

Code: Select all

-O3
since the other two are already included by -O2, which in turn is included by -O3.

See https://gcc.gnu.org/onlinedocs/gcc/Opti ... tions.html

This would have the effect that the compilation process would look cleaner:

Code: Select all

g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -fexpensive-optimizations -O3 -I../../include -Izlib -Ijpeglib -Ilibpng -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1  -c -o CGUITabControl.o CGUITabControl.cpp
vs

Code: Select all

g++ -Wall -pipe -fno-exceptions -fno-rtti -O3 -I../../include -Izlib -Ijpeglib -Ilibpng -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1  -c -o CGUITabControl.o CGUITabControl.cpp
"Whoops..."
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Redundant compiler switches

Post by CuteAlien »

Yeah, guess that's back from gcc3 days where it was not so easy to understand which flags where really enabled.
Thanks, I've changed it in svn trunk [r6190].
I removed -fstrict-aliasing completely. So also gone in debug. Only disadvantage I can think of is that we see the corresponding compile-warnings less often as we mostly compile in debug.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply