User`s guide
Cray XMT™ Programming Environment User’s Guide
7.8 Compiler Messages
There are three categories for compiler messages: errors, warnings, and remarks.
Errors are the most severe and indicate problems that cause the compiler to halt after
parsing without generating object code. Warnings are less severe — the compiler
runs to completion and generates object code. Remarks tend to highlight conditions
that prevent the code from being portable, but the resulting object code almost always
behaves as expected.
7.9 Setting Debugger Options during Compilation
Rather than providing many levels of optimization, the compiler provides the -g1
and -g2 options to support progressing levels of debugging. The debugger options
include the following:
-g, -g1 At this level, the debugger displays the values of variables (including
global variables and array elements) anywhere in their scope.
However, this level causes some loss of optimization. Specifically,
the compiler no longer restructures loops, although basic loop
parallelization is still possible. The -g flag is identical to -g1.
-g2 This is the highest level of debugging support. This level lets you
view and modify variables anywhere in their scope. However, this
level significantly inhibits optimization. Specifically, the compiler no
longer parallelizes loops.
If you do not specify either option, the compiler runs with all optimizations enabled.
Although debugging is not set, you can still perform some debugging operations. For
example, you can control trace control flow using breakpoints together with the step
and next commands. You can also view the value of global variables, although these
can sometimes be out-of-date.
The compiler also has options that perform tracing. Tracing creates a trace file,
trace.out, that you use for performance tuning. You use the -trace option to
turn on tracing and -trace_level n to trace functions larger than n source lines.
You can also trace stack allocation by using the -trace_stack_alloc compiler
option. For more information about the trace option, see the cc(1) or c++(1) man
pages. For information about performance tuning, see Cray XMT Performance Tools
User's Guide.
If you compile an executable using modules that have been compiled at different
debugging levels, the level of debugging support changes between one module and
another, whether inlined or not. For more information about using the Cray XMT
debugger, see Cray XMT Debugger Reference Guide.
88 S–2479–20