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: Alexandre Oliva <aoliva at redhat dot com>
- To: Jakub Jelinek <jakub 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 16:09:18 -0200
- 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> <20171221132608.GZ2353@tucnak>
On Dec 21, 2017, Jakub Jelinek <jakub@redhat.com> wrote:
> 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)
>> + 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)?
AFAICT, if they do at this point, it implies multiple nondebug stmts,
thus nonzero TREE_SIDE_EFFECTS for the list. I'm not even sure we need
to skip multiple being stmt markers at this point, but I couldn't rule
that out easily, so I put the loop in.
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer