This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

Use -O1 optimization but avoid <optimized out>?


I'm currently building with -O1 and -g3, and I'm seeing values as
<optimized out> under the debugger. This is expected (but not
desired).

I'm interested in building my program with -O1 to invoke analysis for
the warnings I have enabled. But I don't want the resulting binary to
have values optimized out when viewing them under the debugger.

Is there a way to use -O1 (for warnings and analysis) but avoid
<optimized out> (for debugging)? If so, then how would I go about it?


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