Changes in gcc/persistence of optimization flags gcc/C

Posted by gnometorule on Stack Overflow See other posts from Stack Overflow or by gnometorule
Published on 2010-05-03T22:35:55Z Indexed on 2010/05/03 22:38 UTC
Read the original article Hit count: 546

Filed under:
|
|

Just curious. Using gcc/gdb under Ubuntu 9.10.

Reading a C book that also often gives the disassembly of the object file. When reading in January, my disassembly looks a lot like the book's; now, it's quite different - possibly more optimized (I notice some re-arrangements in the assembly code now that, at least in the files I checked, look optimized). I have used optimization options -O1 - -O3 for gcc between the first and second read, but not before the first.

(1) Is the use of optimization options persistent, aka, if you use them once, you'll use them until switching them off? That would be weird (browsed man file and at least did not see anything to that sort). In the unlikely case that it is true, how do you switch them off?

(2) Has gcc's assembly changed through any recent upgrade?

(3) Does gcc sometimes produce (significantly) different assembly code although same compile options are chosen?

Thanks much.

© Stack Overflow or respective owner

Related posts about c

    Related posts about gcc