This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb: Ensure compiler doesn't optimise variable out in test


>>>>> "Palmer" == Palmer Dabbelt <palmer@sifive.com> writes:

Palmer> Isn't the compiler still free to kill "a" here because it can see into
Palmer> use_a() and therefor inline it?  I'd expected it to choose to inline
Palmer> use_a(), as doing nothing is always cheaper than calling a function.

It is but in practice gdb compiles without optimization in most cases
and compilers generally don't bother in that situation.  Though if
there's a readily available, more principled fix, that would be fine
too.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]