* common.opt (gas-loc-support, gas-locview-support): New.
(ginline-points, ginternal-reset-location-views): New.
* doc/invoke.texi: Document them. Use @itemx where intended.
(gvariable-location-views): Adjust.
* target.def (reset_location_view): New.
* doc/tm.texi.in (DWARF2_ASM_VIEW_DEBUG_INFO): New.
(TARGET_RESET_LOCATION_VIEW): New.
* doc/tm.texi: Rebuilt.
* dwarf2out.c (dwarf2out_default_as_loc_support): New.
(dwarf2out_default_as_locview_support): New.
(output_asm_line_debug_info): Use option variables.
(dwarf2out_maybe_output_loclist_view_pair): Likewise.
(output_loc_list): Likewise.
(add_high_low_attributes): Check option variables.
Don't output entry view attribute in strict mode.
(gen_inlined_subroutine_die): Check option variables.
(dwarf2out_inline_entry): Likewise.
(init_sections_and_labels): Likewise.
(dwarf2out_early_finish): Likewise.
(maybe_reset_location_view): New, from...
(dwarf2out_var_location): ... here. Call it.
* debug.h (dwarf2out_default_as_loc_support): Declare.
(dwarf2out_default_as_locview_support): Declare.
* hooks.c (hook_int_rtx_insn_0): New.
* hooks.h (hook_int_rtx_insn_0): Declare.
* toplev.c (process_options): Take -gas-loc-support and
-gas-locview-support from dwarf2out. Enable
-gvariable-location-views by default only with locview
assembler support. Enable -ginternal-reset-location-views by
default only if the target defines the corresponding hook.
Enable -ginline-points by default if location views are
enabled; force it disabled if statement frontiers are
disabled.
* tree-inline.c (expand_call_inline): Check option variables.
* tree-ssa-live.c (remove_unused_scope_block_p): Likewise.
From-SVN: r257631
+2018-02-13 Alexandre Oliva <aoliva@redhat.com>
+
+ * common.opt (gas-loc-support, gas-locview-support): New.
+ (ginline-points, ginternal-reset-location-views): New.
+ * doc/invoke.texi: Document them. Use @itemx where intended.
+ (gvariable-location-views): Adjust.
+ * target.def (reset_location_view): New.
+ * doc/tm.texi.in (DWARF2_ASM_VIEW_DEBUG_INFO): New.
+ (TARGET_RESET_LOCATION_VIEW): New.
+ * doc/tm.texi: Rebuilt.
+ * dwarf2out.c (dwarf2out_default_as_loc_support): New.
+ (dwarf2out_default_as_locview_support): New.
+ (output_asm_line_debug_info): Use option variables.
+ (dwarf2out_maybe_output_loclist_view_pair): Likewise.
+ (output_loc_list): Likewise.
+ (add_high_low_attributes): Check option variables.
+ Don't output entry view attribute in strict mode.
+ (gen_inlined_subroutine_die): Check option variables.
+ (dwarf2out_inline_entry): Likewise.
+ (init_sections_and_labels): Likewise.
+ (dwarf2out_early_finish): Likewise.
+ (maybe_reset_location_view): New, from...
+ (dwarf2out_var_location): ... here. Call it.
+ * debug.h (dwarf2out_default_as_loc_support): Declare.
+ (dwarf2out_default_as_locview_support): Declare.
+ * hooks.c (hook_int_rtx_insn_0): New.
+ * hooks.h (hook_int_rtx_insn_0): Declare.
+ * toplev.c (process_options): Take -gas-loc-support and
+ -gas-locview-support from dwarf2out. Enable
+ -gvariable-location-views by default only with locview
+ assembler support. Enable -ginternal-reset-location-views by
+ default only if the target defines the corresponding hook.
+ Enable -ginline-points by default if location views are
+ enabled; force it disabled if statement frontiers are
+ disabled.
+ * tree-inline.c (expand_call_inline): Check option variables.
+ * tree-ssa-live.c (remove_unused_scope_block_p): Likewise.
+
2018-02-13 Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/84321
Common Driver RejectNegative JoinedOrMissing
Generate debug information in default format.
+gas-loc-support
+Common Driver Var(dwarf2out_as_loc_support) Init(2)
+Assume assembler support for (DWARF2+) .loc directives
+
+gas-locview-support
+Common Driver Var(dwarf2out_as_locview_support) Init(2)
+Assume assembler support for view in (DWARF2+) .loc directives
+
gcoff
Common Driver Ignore Warn(switch %qs no longer supported)
Does nothing. Preserved for backward compatibility.
Common Driver JoinedOrMissing
Generate debug information in default extended format.
+ginline-points
+Common Driver Var(debug_inline_points) Init(2)
+Generate extended entry point information for inlined functions
+
+ginternal-reset-location-views
+Common Driver Var(debug_internal_reset_location_views) Init(2)
+Compute locview reset points based on insn length estimates
+
gno-
RejectNegative Joined Undocumented
; Catch the gno- prefix, so it doesn't backtrack to g<level>.
extern bool dwarf2out_do_frame (void);
extern bool dwarf2out_do_cfi_asm (void);
extern void dwarf2out_switch_text_section (void);
+extern bool dwarf2out_default_as_loc_support (void);
+extern bool dwarf2out_default_as_locview_support (void);
/* For -fdump-go-spec. */
@gccoptlist{-g -g@var{level} -gdwarf -gdwarf-@var{version} @gol
-ggdb -grecord-gcc-switches -gno-record-gcc-switches @gol
-gstabs -gstabs+ -gstrict-dwarf -gno-strict-dwarf @gol
+-gas-loc-support -gno-as-loc-support @gol
+-gas-locview-support -gno-as-locview-support @gol
-gcolumn-info -gno-column-info @gol
-gstatement-frontiers -gno-statement-frontiers @gol
-gvariable-location-views -gno-variable-location-views @gol
+-ginternal-reset-location-views -gno-internal-reset-location-views @gol
+-ginline-points -gno-inline-points @gol
-gvms -gxcoff -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
-fdebug-prefix-map=@var{old}=@var{new} -fdebug-types-section @gol
-fno-eliminate-unused-debug-types @gol
@table @gcctabopt
@item -Wformat-overflow
-@item -Wformat-overflow=1
+@itemx -Wformat-overflow=1
@opindex Wformat-overflow
@opindex Wno-format-overflow
Level @var{1} of @option{-Wformat-overflow} enabled by @option{-Wformat}
@table @gcctabopt
@item -Wformat-truncation
-@item -Wformat-truncation=1
+@itemx -Wformat-truncation=1
@opindex Wformat-truncation
@opindex Wno-format-overflow
Level @var{1} of @option{-Wformat-truncation} enabled by @option{-Wformat}
@table @gcctabopt
@item -Wstringop-overflow
-@item -Wstringop-overflow=1
+@itemx -Wstringop-overflow=1
@opindex Wstringop-overflow
@opindex Wno-stringop-overflow
The @option{-Wstringop-overflow=1} option uses type-zero Object Size Checking
debugging information.
@item -grecord-gcc-switches
-@item -gno-record-gcc-switches
+@itemx -gno-record-gcc-switches
@opindex grecord-gcc-switches
@opindex gno-record-gcc-switches
This switch causes the command-line options used to invoke the
Allow using extensions of later DWARF standard version than selected with
@option{-gdwarf-@var{version}}.
+@item -gas-loc-support
+@opindex gas-loc-support
+Inform the compiler that the assembler supports @code{.loc} directives.
+It may then use them for the assembler to generate DWARF2+ line number
+tables.
+
+This is generally desirable, because assembler-generated line-number
+tables are a lot more compact than those the compiler can generate
+itself.
+
+This option will be enabled by default if, at GCC configure time, the
+assembler was found to support such directives.
+
+@item -gno-as-loc-support
+@opindex gno-as-loc-support
+Force GCC to generate DWARF2+ line number tables internally, if DWARF2+
+line number tables are to be generated.
+
+@item gas-locview-support
+@opindex gas-locview-support
+Inform the compiler that the assembler supports @code{view} assignment
+and reset assertion checking in @code{.loc} directives.
+
+This option will be enabled by default if, at GCC configure time, the
+assembler was found to support them.
+
+@item gno-as-locview-support
+Force GCC to assign view numbers internally, if
+@option{-gvariable-location-views} are explicitly requested.
+
@item -gcolumn-info
-@item -gno-column-info
+@itemx -gno-column-info
@opindex gcolumn-info
@opindex gno-column-info
Emit location column information into DWARF debugging information, rather
This option is enabled by default.
@item -gstatement-frontiers
-@item -gno-statement-frontiers
+@itemx -gno-statement-frontiers
@opindex gstatement-frontiers
@opindex gno-statement-frontiers
This option causes GCC to create markers in the internal representation
@dots{}), and outputting DWARF 2 debug information at the normal level.
@item -gvariable-location-views
-@item -gvariable-location-views=incompat5
-@item -gno-variable-location-views
+@itemx -gvariable-location-views=incompat5
+@itemx -gno-variable-location-views
@opindex gvariable-location-views
@opindex gvariable-location-views=incompat5
@opindex gno-variable-location-views
number tables and location lists are fully backward-compatible, so they
can be consumed by debug information consumers that are not aware of
these augmentations, but they won't derive any benefit from them either.
+
This is enabled by default when outputting DWARF 2 debug information at
-the normal level, as long as @option{-fvar-tracking-assignments} is
-enabled and @option{-gstrict-dwarf} is not.
+the normal level, as long as there is assembler support,
+@option{-fvar-tracking-assignments} is enabled and
+@option{-gstrict-dwarf} is not. When assembler support is not
+available, this may still be enabled, but it will force GCC to output
+internal line number tables, and if
+@option{-ginternal-reset-location-views} is not enabled, that will most
+certainly lead to silently mismatching location views.
There is a proposed representation for view numbers that is not backward
compatible with the location list format introduced in DWARF 5, that can
consumers are not expected to support this extended format, and they
would be rendered unable to decode location lists using it.
+@item -ginternal-reset-location-views
+@itemx -gnointernal-reset-location-views
+@opindex ginternal-reset-location-views
+@opindex gno-internal-reset-location-views
+Attempt to determine location views that can be omitted from location
+view lists. This requires the compiler to have very accurate insn
+length estimates, which isn't always the case, and it may cause
+incorrect view lists to be generated silently when using an assembler
+that does not support location view lists. The GNU assembler will flag
+any such error as a @code{view number mismatch}. This is only enabled
+on ports that define a reliable estimation function.
+
+@item -ginline-points
+@itemx -gno-inline-points
+@opindex ginline-points
+@opindex gno-inline-points
+Generate extended debug information for inlined functions. Location
+view tracking markers are inserted at inlined entry points, so that
+address and view numbers can be computed and output in debug
+information. This can be enabled independently of location views, in
+which case the view numbers won't be output, but it can only be enabled
+along with statement frontiers, and it is only enabled by default if
+location views are enabled.
+
@item -gz@r{[}=@var{type}@r{]}
@opindex gz
Produce compressed debug sections in DWARF format, if that is supported.
profitable.
@item max-rtl-if-conversion-predictable-cost
-@item max-rtl-if-conversion-unpredictable-cost
+@itemx max-rtl-if-conversion-unpredictable-cost
RTL if-conversion will try to remove conditional branches around a block
and replace them with conditionally executed instructions. These parameters
give the maximum permissible cost for the sequence that would be generated
pointer parameter.
@item sra-max-scalarization-size-Ospeed
-@item sra-max-scalarization-size-Osize
+@itemx sra-max-scalarization-size-Osize
The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
replace scalar parts of aggregates with uses of independent scalar
variables. These parameters control the maximum size, in storage units,
corresponding flag to the linker.
@item -mlow-precision-recip-sqrt
-@item -mno-low-precision-recip-sqrt
+@itemx -mno-low-precision-recip-sqrt
@opindex mlow-precision-recip-sqrt
@opindex mno-low-precision-recip-sqrt
Enable or disable the reciprocal square root approximation.
single precision and to 32 bits for double precision.
@item -mlow-precision-sqrt
-@item -mno-low-precision-sqrt
+@itemx -mno-low-precision-sqrt
@opindex -mlow-precision-sqrt
@opindex -mno-low-precision-sqrt
Enable or disable the square root approximation.
If enabled, it implies @option{-mlow-precision-recip-sqrt}.
@item -mlow-precision-div
-@item -mno-low-precision-div
+@itemx -mno-low-precision-div
@opindex -mlow-precision-div
@opindex -mno-low-precision-div
Enable or disable the division approximation.
not intended for ordinary use in compiling user code.
@item -minterlink-compressed
-@item -mno-interlink-compressed
+@itemx -mno-interlink-compressed
@opindex minterlink-compressed
@opindex mno-interlink-compressed
Require (do not require) that code using the standard (uncompressed) MIPS ISA
assembler files (with a @samp{.s} suffix) when assembling them.
@item -mfix-24k
-@item -mno-fix-24k
+@itemx -mno-fix-24k
@opindex mfix-24k
@opindex mno-fix-24k
Work around the 24K E48 (lost data on stores during refill) errata.
sections. The default value of @var{num} is 8.
@item -mgpopt=@var{option}
-@item -mgpopt
+@itemx -mgpopt
@itemx -mno-gpopt
@opindex mgpopt
@opindex mno-gpopt
@option{-m32bit-doubles}.
@item -msave-mduc-in-interrupts
-@item -mno-save-mduc-in-interrupts
+@itemx -mno-save-mduc-in-interrupts
@opindex msave-mduc-in-interrupts
@opindex mno-save-mduc-in-interrupts
Specifies that interrupt handler functions should preserve the
comparison is unordered.
@item -m80387
-@item -mhard-float
+@itemx -mhard-float
@opindex 80387
@opindex mhard-float
Generate output containing 80387 instructions for floating point.
@item -mno-80387
-@item -msoft-float
+@itemx -msoft-float
@opindex no-80387
@opindex msoft-float
Generate output containing library calls for floating point.
tables, and hence is desirable if it works.
@end defmac
+@defmac DWARF2_ASM_VIEW_DEBUG_INFO
+Define this macro to be a nonzero value if the assembler supports view
+assignment and verification in @code{.loc}. If it does not, but the
+user enables location views, the compiler may have to fallback to
+internal line number tables.
+@end defmac
+
+@deftypefn {Target Hook} int TARGET_RESET_LOCATION_VIEW (rtx_insn *@var{})
+This hook, if defined, enables -ginternal-reset-location-views, and
+uses its result to override cases in which the estimated min insn
+length might be nonzero even when a PC advance (i.e., a view reset)
+cannot be taken for granted.
+
+If the hook is defined, it must return a positive value to indicate
+the insn definitely advances the PC, and so the view number can be
+safely assumed to be reset; a negative value to mean the insn
+definitely does not advance the PC, and os the view number must not
+be reset; or zero to decide based on the estimated insn length.
+
+If insn length is to be regarded as reliable, set the hook to
+@code{hook_int_rtx_insn_0}.
+@end deftypefn
+
@deftypevr {Target Hook} bool TARGET_WANT_DEBUG_PUB_SECTIONS
True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections should be emitted. These sections are not used on most platforms, and in particular GDB does not use them.
@end deftypevr
tables, and hence is desirable if it works.
@end defmac
+@defmac DWARF2_ASM_VIEW_DEBUG_INFO
+Define this macro to be a nonzero value if the assembler supports view
+assignment and verification in @code{.loc}. If it does not, but the
+user enables location views, the compiler may have to fallback to
+internal line number tables.
+@end defmac
+
+@hook TARGET_RESET_LOCATION_VIEW
+
@hook TARGET_WANT_DEBUG_PUB_SECTIONS
@hook TARGET_DELAY_SCHED2
vec<dw_line_info_entry, va_gc> *entries;
};
+/* If we're keep track of location views and their reset points, and
+ INSN is a reset point (i.e., it necessarily advances the PC), mark
+ the next view in TABLE as reset. */
+
+static void
+maybe_reset_location_view (rtx_insn *insn, dw_line_info_table *table)
+{
+ if (!debug_internal_reset_location_views)
+ return;
+
+ /* Maybe turn (part of?) this test into a default target hook. */
+ int reset = 0;
+
+ if (targetm.reset_location_view)
+ reset = targetm.reset_location_view (insn);
+
+ if (reset)
+ ;
+ else if (JUMP_TABLE_DATA_P (insn))
+ reset = 1;
+ else if (GET_CODE (insn) == USE
+ || GET_CODE (insn) == CLOBBER
+ || GET_CODE (insn) == ASM_INPUT
+ || asm_noperands (insn) >= 0)
+ ;
+ else if (get_attr_min_length (insn) > 0)
+ reset = 1;
+
+ if (reset > 0)
+ RESET_NEXT_VIEW (table->view);
+}
/* Each DIE attribute has a field specifying the attribute kind,
a link to the next attribute in the chain, and an attribute value.
#endif
#endif
+/* Return true if GCC configure detected assembler support for .loc. */
+
+bool
+dwarf2out_default_as_loc_support (void)
+{
+ return DWARF2_ASM_LINE_DEBUG_INFO;
+#if (GCC_VERSION >= 3000)
+# undef DWARF2_ASM_LINE_DEBUG_INFO
+# pragma GCC poison DWARF2_ASM_LINE_DEBUG_INFO
+#endif
+}
+
+/* Return true if GCC configure detected assembler support for views
+ in .loc directives. */
+
+bool
+dwarf2out_default_as_locview_support (void)
+{
+ return DWARF2_ASM_VIEW_DEBUG_INFO;
+#if (GCC_VERSION >= 3000)
+# undef DWARF2_ASM_VIEW_DEBUG_INFO
+# pragma GCC poison DWARF2_ASM_VIEW_DEBUG_INFO
+#endif
+}
+
/* A bit is set in ZERO_VIEW_P if we are using the assembler-supported
view computation, and it refers to a view identifier for which we
will not emit a label because it is known to map to a view number
static bool
output_asm_line_debug_info (void)
{
- return (DWARF2_ASM_VIEW_DEBUG_INFO
- || (DWARF2_ASM_LINE_DEBUG_INFO
- && !debug_variable_location_views));
+ return (dwarf2out_as_loc_support
+ && (dwarf2out_as_locview_support
+ || !debug_variable_location_views));
}
/* Minimum line offset in a special line info. opcode.
#ifdef DW_LLE_view_pair
dw2_asm_output_data (1, DW_LLE_view_pair, "DW_LLE_view_pair");
-# if DWARF2_ASM_VIEW_DEBUG_INFO
- if (ZERO_VIEW_P (curr->vbegin))
- dw2_asm_output_data_uleb128 (0, "Location view begin");
- else
+ if (dwarf2out_as_locview_support)
{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
- ASM_GENERATE_INTERNAL_LABEL (label, "LVU", curr->vbegin);
- dw2_asm_output_symname_uleb128 (label, "Location view begin");
- }
+ if (ZERO_VIEW_P (curr->vbegin))
+ dw2_asm_output_data_uleb128 (0, "Location view begin");
+ else
+ {
+ char label[MAX_ARTIFICIAL_LABEL_BYTES];
+ ASM_GENERATE_INTERNAL_LABEL (label, "LVU", curr->vbegin);
+ dw2_asm_output_symname_uleb128 (label, "Location view begin");
+ }
- if (ZERO_VIEW_P (curr->vend))
- dw2_asm_output_data_uleb128 (0, "Location view end");
+ if (ZERO_VIEW_P (curr->vend))
+ dw2_asm_output_data_uleb128 (0, "Location view end");
+ else
+ {
+ char label[MAX_ARTIFICIAL_LABEL_BYTES];
+ ASM_GENERATE_INTERNAL_LABEL (label, "LVU", curr->vend);
+ dw2_asm_output_symname_uleb128 (label, "Location view end");
+ }
+ }
else
{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
- ASM_GENERATE_INTERNAL_LABEL (label, "LVU", curr->vend);
- dw2_asm_output_symname_uleb128 (label, "Location view end");
+ dw2_asm_output_data_uleb128 (curr->vbegin, "Location view begin");
+ dw2_asm_output_data_uleb128 (curr->vend, "Location view end");
}
-# else /* !DWARF2_ASM_VIEW_DEBUG_INFO */
- dw2_asm_output_data_uleb128 (curr->vbegin, "Location view begin");
- dw2_asm_output_data_uleb128 (curr->vend, "Location view end");
-# endif /* DWARF2_ASM_VIEW_DEBUG_INFO */
#endif /* DW_LLE_view_pair */
return;
vcount++;
/* ?? dwarf_split_debug_info? */
-#if DWARF2_ASM_VIEW_DEBUG_INFO
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- if (!ZERO_VIEW_P (curr->vbegin))
+ if (dwarf2out_as_locview_support)
{
- ASM_GENERATE_INTERNAL_LABEL (label, "LVU", curr->vbegin);
- dw2_asm_output_symname_uleb128 (label,
- "View list begin (%s)",
- list_head->vl_symbol);
+ char label[MAX_ARTIFICIAL_LABEL_BYTES];
+
+ if (!ZERO_VIEW_P (curr->vbegin))
+ {
+ ASM_GENERATE_INTERNAL_LABEL (label, "LVU", curr->vbegin);
+ dw2_asm_output_symname_uleb128 (label,
+ "View list begin (%s)",
+ list_head->vl_symbol);
+ }
+ else
+ dw2_asm_output_data_uleb128 (0,
+ "View list begin (%s)",
+ list_head->vl_symbol);
+
+ if (!ZERO_VIEW_P (curr->vend))
+ {
+ ASM_GENERATE_INTERNAL_LABEL (label, "LVU", curr->vend);
+ dw2_asm_output_symname_uleb128 (label,
+ "View list end (%s)",
+ list_head->vl_symbol);
+ }
+ else
+ dw2_asm_output_data_uleb128 (0,
+ "View list end (%s)",
+ list_head->vl_symbol);
}
else
- dw2_asm_output_data_uleb128 (0,
- "View list begin (%s)",
- list_head->vl_symbol);
-
- if (!ZERO_VIEW_P (curr->vend))
{
- ASM_GENERATE_INTERNAL_LABEL (label, "LVU", curr->vend);
- dw2_asm_output_symname_uleb128 (label,
- "View list end (%s)",
- list_head->vl_symbol);
+ dw2_asm_output_data_uleb128 (curr->vbegin,
+ "View list begin (%s)",
+ list_head->vl_symbol);
+ dw2_asm_output_data_uleb128 (curr->vend,
+ "View list end (%s)",
+ list_head->vl_symbol);
}
- else
- dw2_asm_output_data_uleb128 (0,
- "View list end (%s)",
- list_head->vl_symbol);
-#else /* !DWARF2_ASM_VIEW_DEBUG_INFO */
- dw2_asm_output_data_uleb128 (curr->vbegin,
- "View list begin (%s)",
- list_head->vl_symbol);
- dw2_asm_output_data_uleb128 (curr->vend,
- "View list end (%s)",
- list_head->vl_symbol);
-#endif
}
}
{
inline_entry_data *ied = *iedp;
gcc_assert (MAY_HAVE_DEBUG_MARKER_INSNS);
+ gcc_assert (debug_inline_points);
gcc_assert (inlined_function_outer_scope_p (stmt));
+
ASM_GENERATE_INTERNAL_LABEL (label, ied->label_pfx, ied->label_num);
add_AT_lbl_id (die, DW_AT_entry_pc, label);
- if (debug_variable_location_views && !ZERO_VIEW_P (ied->view))
+ if (debug_variable_location_views && !ZERO_VIEW_P (ied->view)
+ && !dwarf_strict)
{
if (!output_asm_line_debug_info ())
add_AT_unsigned (die, DW_AT_GNU_entry_view, ied->view);
dw_die_ref pdie;
dw_attr_node *attr = NULL;
- if (!MAY_HAVE_DEBUG_MARKER_INSNS && inlined_function_outer_scope_p (stmt))
+ if (!debug_inline_points && inlined_function_outer_scope_p (stmt))
{
ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_BEGIN_LABEL,
BLOCK_NUMBER (stmt));
dw_die_ref subr_die
= new_die (DW_TAG_inlined_subroutine, context_die, stmt);
- if (call_arg_locations || MAY_HAVE_DEBUG_MARKER_INSNS)
+ if (call_arg_locations || debug_inline_points)
BLOCK_DIE (stmt) = subr_die;
add_abstract_origin_attribute (subr_die, decl);
if (TREE_ASM_WRITTEN (stmt))
{
if (CALL_P (loc_note))
{
- RESET_NEXT_VIEW (cur_line_info_table->view);
+ maybe_reset_location_view (loc_note, cur_line_info_table);
call_site_count++;
if (SIBLING_CALL_P (loc_note))
tail_call_site_count++;
}
else if (!debug_variable_location_views)
gcc_unreachable ();
- else if (JUMP_TABLE_DATA_P (loc_note))
- RESET_NEXT_VIEW (cur_line_info_table->view);
- else if (GET_CODE (loc_note) == USE
- || GET_CODE (loc_note) == CLOBBER
- || GET_CODE (loc_note) == ASM_INPUT
- || asm_noperands (loc_note) >= 0)
- ;
- else if (get_attr_min_length (loc_note) > 0)
- RESET_NEXT_VIEW (cur_line_info_table->view);
+ else
+ maybe_reset_location_view (loc_note, cur_line_info_table);
return;
}
static void
dwarf2out_inline_entry (tree block)
{
+ gcc_assert (debug_inline_points);
+
/* If we can't represent it, don't bother. */
if (!(dwarf_version >= 3 || !dwarf_strict))
return;
debug_str_section = get_section (DEBUG_LTO_STR_SECTION,
DEBUG_STR_SECTION_FLAGS
| SECTION_EXCLUDE, NULL);
- if (!dwarf_split_debug_info && !DWARF2_ASM_LINE_DEBUG_INFO)
+ if (!dwarf_split_debug_info && !dwarf2out_as_loc_support)
debug_line_str_section
= get_section (DEBUG_LTO_LINE_STR_SECTION,
DEBUG_STR_SECTION_FLAGS | SECTION_EXCLUDE, NULL);
/* When emitting DWARF5 .debug_line_str, move DW_AT_name and
DW_AT_comp_dir into .debug_line_str section. */
- if (!DWARF2_ASM_LINE_DEBUG_INFO
+ if (!dwarf2out_as_loc_support
&& dwarf_version >= 5
&& DWARF5_USE_DEBUG_LINE_STR)
{
return 1;
}
+int
+hook_int_rtx_insn_0 (rtx_insn *)
+{
+ return 0;
+}
+
int
hook_int_rtx_insn_unreachable (rtx_insn *)
{
extern int hook_int_const_tree_const_tree_1 (const_tree, const_tree);
extern int hook_int_rtx_0 (rtx);
extern int hook_int_rtx_1 (rtx);
+extern int hook_int_rtx_insn_0 (rtx_insn *);
extern int hook_int_rtx_insn_unreachable (rtx_insn *);
extern int hook_int_rtx_bool_0 (rtx, bool);
extern int hook_int_rtx_mode_as_bool_0 (rtx, machine_mode, addr_space_t,
enum unwind_info_type, (void),
default_debug_unwind_info)
+DEFHOOK
+(reset_location_view, "\
+This hook, if defined, enables -ginternal-reset-location-views, and\n\
+uses its result to override cases in which the estimated min insn\n\
+length might be nonzero even when a PC advance (i.e., a view reset)\n\
+cannot be taken for granted.\n\
+\n\
+If the hook is defined, it must return a positive value to indicate\n\
+the insn definitely advances the PC, and so the view number can be\n\
+safely assumed to be reset; a negative value to mean the insn\n\
+definitely does not advance the PC, and os the view number must not\n\
+be reset; or zero to decide based on the estimated insn length.\n\
+\n\
+If insn length is to be regarded as reliable, set the hook to\n\
+@code{hook_int_rtx_insn_0}.",
+ int, (rtx_insn *), NULL)
+
/* The code parameter should be of type enum rtx_code but this is not
defined at this time. */
DEFHOOK
|| write_symbols == VMS_AND_DWARF2_DEBUG)
&& !(flag_selective_scheduling || flag_selective_scheduling2));
+ if (dwarf2out_as_loc_support == AUTODETECT_VALUE)
+ dwarf2out_as_loc_support
+ = dwarf2out_default_as_loc_support ();
+ if (dwarf2out_as_locview_support == AUTODETECT_VALUE)
+ dwarf2out_as_locview_support
+ = dwarf2out_default_as_locview_support ();
+
if (debug_variable_location_views == AUTODETECT_VALUE)
{
- debug_variable_location_views = flag_var_tracking
- && debug_info_level >= DINFO_LEVEL_NORMAL
- && (write_symbols == DWARF2_DEBUG
- || write_symbols == VMS_AND_DWARF2_DEBUG)
- && !dwarf_strict;
+ debug_variable_location_views
+ = (flag_var_tracking
+ && debug_info_level >= DINFO_LEVEL_NORMAL
+ && (write_symbols == DWARF2_DEBUG
+ || write_symbols == VMS_AND_DWARF2_DEBUG)
+ && !dwarf_strict
+ && dwarf2out_as_loc_support
+ && dwarf2out_as_locview_support);
}
else if (debug_variable_location_views == -1 && dwarf_version != 5)
{
debug_variable_location_views = 1;
}
+ if (debug_internal_reset_location_views == 2)
+ {
+ debug_internal_reset_location_views
+ = (debug_variable_location_views
+ && targetm.reset_location_view);
+ }
+ else if (debug_internal_reset_location_views
+ && !debug_variable_location_views)
+ {
+ warning_at (UNKNOWN_LOCATION, 0,
+ "-ginternal-reset-location-views is forced disabled "
+ "without -gvariable-location-views");
+ debug_internal_reset_location_views = 0;
+ }
+
+ if (debug_inline_points == AUTODETECT_VALUE)
+ debug_inline_points = debug_variable_location_views;
+ else if (debug_inline_points && !debug_nonbind_markers_p)
+ {
+ warning_at (UNKNOWN_LOCATION, 0,
+ "-ginline-points is forced disabled without "
+ "-gstatement-frontiers");
+ debug_inline_points = 0;
+ }
+
if (flag_tree_cselim == AUTODETECT_VALUE)
{
if (HAVE_conditional_move)
GSI_NEW_STMT);
}
initialize_inlined_parameters (id, stmt, fn, bb);
- if (debug_nonbind_markers_p && id->block
+ if (debug_nonbind_markers_p && debug_inline_points && id->block
&& inlined_function_outer_scope_p (id->block))
{
gimple_stmt_iterator si = gsi_last_bb (bb);
unused = false;
/* Preserve the block, it is referenced by at least the inline
entry point marker. */
- else if (debug_nonbind_markers_p
+ else if (debug_inline_points
&& inlined_function_outer_scope_p (scope))
unused = false;
/* Innermost blocks with no live variables nor statements can be always
with block_ultimate_origin being set to FUNCTION_DECL and
DECL_SOURCE_LOCATION set, unless they expand to nothing... But
see above for the case of statement frontiers. */
- else if (!debug_nonbind_markers_p
+ else if (!debug_inline_points
&& inlined_function_outer_scope_p (scope))
unused = false;
else