I’m not positive, because I am far from an expert on GCC, but I believe you can (or at least should) only select one optimization level at a time. There are a number of different things that could be done to optimize a program. In GCC, these are controlled by individual flags, each of which controls a specific optimization action. I believe that the different levels end up setting different combinations of optimization flags. In the version I use, I can set a level, and I can also control some other optimization flags from the IDE. If you select more than one level at a time, you may end up with a combination of flags.
You could try setting various combinations of levels, and then look at what flags actually get set.
Keep in mind that optimizing for one attribute may be detrimental to another. In general, with any compiler, going from no optimization to the first level of optimization will result in an increase in speed and a decrease in size. This is because a bunch of unnecessary stuff gets thrown out. When you start optimizing beyond that, you may start trading off speed for size. Optimization can also play havoc with debugging, particularly single stepping. And some optimizations may mess with others. (That is, “Some combinations of flags may result in code that does not work as expected!”)
I would recommend that you come up with some sort of benchmark so you have an idea of the effect of different optimizations. Size is easy, you can just look at the resulting code size. Speed is a bit more challenging. You may not even need any speed optimization, but only you can make that determination.
You may want to get a copy of the book “An Introduction to GCC for the GNU Compiler gcc and g++”, written by Brian Gough. Published by Network Theory Limited ISBN 0-9541617-9-3
Thanks for the detailed explanation.
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Private Sub btn_addline_Click(ByVal ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...