This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -fcompare-debug due to DEBUG_BEGIN_STMTs (PR debug/83419)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: Richard Biener <rguenther at suse dot de>, Jeff Law <law at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Dec 2017 14:26:08 +0100
- Subject: Re: [PATCH] Fix -fcompare-debug due to DEBUG_BEGIN_STMTs (PR debug/83419)
- Authentication-results: sourceware.org; auth=none
- References: <20171214200135.GY2353@tucnak> <alpine.LSU.2.20.1712150930570.12252@zhemvz.fhfr.qr> <orlghxvtgv.fsf@lxoliva.fsfla.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Dec 20, 2017 at 10:02:24PM -0200, Alexandre Oliva wrote:
> --- a/gcc/c-family/c-semantics.c
> +++ b/gcc/c-family/c-semantics.c
> @@ -96,6 +96,15 @@ pop_stmt_list (tree t)
> t = l;
> tsi_link_before (&i, u, TSI_SAME_STMT);
> }
> + while (!tsi_end_p (i)
> + && TREE_CODE (tsi_stmt (i)) == DEBUG_BEGIN_STMT)
> + tsi_next (&i);
> + /* If there's only one nondebug stmt in the list, we'd have
> + extracted the stmt and dropped the list, and we'd take
> + TREE_SIDE_EFFECTS from that statement, so keep the list's
> + TREE_SIDE_EFFECTS in sync. */
> + if (tsi_one_before_end_p (i))
> + TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (tsi_stmt (i));
So DEBUG_BEGIN_STMTs after the single non-DEBUG_BEGIN_STMT stmt in
the STATEMENT_LIST can't happen (or just we don't have a testcase for it)?
Jakub