This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix -fcompare-debug due to DEBUG_BEGIN_STMTs (PR debug/83419)


On Mon, Dec 18, 2017 at 02:17:18PM +0100, Jakub Jelinek wrote:
> One option would be to deal with that in pop_stmt_list and the C++ caller
> thereof, where we right now have:
> 
>       /* If the statement list contained exactly one statement, then
>          extract it immediately.  */
>       if (tsi_one_before_end_p (i))
>         {
>           u = tsi_stmt (i);
>           tsi_delink (&i);
>           free_stmt_list (t);
>           t = u;
>         }
> 
> This part would need a MAY_HAVE_DEBUG_MARKER_STMTS variant that would
> check for the case where there are just DEBUG_BEGIN_STMT markers + one other
> stmt (+ maybe some further DEBUG_BEGIN_STMT markers) and nothing else.
> If that one other stmt doesn't have TREE_SIDE_EFFECTS, clear
> TREE_SIDE_EFFECTS on the whole statement list to get the same
> TREE_SIDE_EFFECTS from the returned expression as without -g.

Like this (the cp_parser_omp_for_loop_init function would need similar
changes).  Except while it works for this new testcase and some of the
testcases I've listed, it still doesn't work for others.

Alex, I'm giving up here.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]