On 06/27/2018 07:24 AM, Eric Botcazou wrote:
> Hi,
> 
> the Ada compiler uses small functions defined in its runtime to implement 
> various intrinsic operations and it always inlines them, even at -O0.  But it 
> doesn't want location information from the runtime files to appear in the 
> debug info so it puts DECL_IGNORED_P on these functions.  final.c already 
> knows how not to generate location information for DECL_IGNORED_P functions 
> when they are standalone but that's not the case for the inliner, i.e. it 
> leaks location information from these functions where they are inlined.
> 
> The attached patch is aimed at preventing this from happening by explicitly 
> forcing input_location on the inlined bodies in this case.
> 
> Tested (GCC and GDB) on x86-64/Linux, OK for the mainline?
> 
> 
> 2018-06-27  Eric Botcazou  <ebotca...@adacore.com>
> 
>       * tree-inline.c (remap_gimple_stmt): Force input_location on the new
>       statement if id->reset_location is true.
>       (copy_edges_for_bb): Do not set goto_locus on the new edges if
>       id->reset_location is true.
>       (copy_phis_for_bb): Force input_location on the arguments if
>       id->reset_location is true.
>       (expand_call_inline): Set id->reset_location if DECL_IGNORED_P
>       is set on the function to be inlined.
>       * tree-inline.h (struct copy_body_data): Move remapping_type_depth and
>       prevent_decl_creation_for_types fields up and add reset_location field.
> 
> 
> 2018-06-27  Eric Botcazou  <ebotca...@adacore.com>
> 
>         * gnat.dg/debug15.adb: New test.
More references to input_location aren't ideal.  But I don't think
that's a strong enough reason to reject.  OK for the trunk.

jeff

Reply via email to