Compiler optimization question
Hi! First I wonder, is qmake a compiler or does it just create makefiles that it uses when compiling the code with another compiler, say gcc or mingw? My second question is, does qmake optimize multiplication/division by one? That is, if I write
or
or
, is this optimized to just
? Here, "one" is either a define or a const that is set to one. Also, does it depend on whether a and b are float types, and on whether one is a float type?
Re: Compiler optimization question
qmake is not a compiler. It just creates the make files (depending on the used mkspec it generates the make file for different compilers.)
If the code you have posted is optimized depends on your compiler. But you can make a simple program, compile it and see yourself in the assembler code.
Re: Compiler optimization question
How do I do that? My compiler should be mingw, since I have downloaded the mingw version of Qt Library and also Qt Creator.