Re: Authoritative answer wanted: "-g -O1" vs. "-O1"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013/6/18 Ian Lance Taylor <iant@xxxxxxxxxx>:
> On Mon, Jun 17, 2013 at 10:21 PM, Gene Smith <gds@xxxxxxxxxxxxx> wrote:
>> Is this difference expected? Should -g cause changes in the actual code
>> generated and not just add debug symbols to the elf? Possibly it is related
>> to the optimization level? I have not checked to see if the results differ
>> with higher or lower levels than -O1.
>>
>> I have seen several opinions regarding this but no authoritative answer. The
>> gcc manual also does not really answer this.
>
> If the only change in the command line options is whether you use -g,
> you should get exactly the same code.  Any difference in code
> generation is a bug.  Please try to file a bug report according to the
> guidelines at http://gcc.gnu.org/bugs/ .  Thanks.
>
> Ian

Hi, Gene,

I also suggest to check assembly code sequence by having '-S'
compilation option instead of using objdump to the binary.
So that the influence of assembler/linker can be ruled out.


Best regards,
jasonwucj




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux