This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Do not leak location information during inlining (2nd try)
- From: Jeff Law <law at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 27 Jun 2018 20:22:28 -0600
- Subject: Re: [patch] Do not leak location information during inlining (2nd try)
- References: <29428106.Dqe6L3Y5Rm@polaris>
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 <ebotcazou@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 <ebotcazou@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