Page 1 of 1

[fixed]Redundant compiler switches

Posted: Fri Feb 12, 2021 9:25 am
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

Re: Redundant compiler switches

Posted: Fri Feb 12, 2021 11:35 am
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.