On Tue, Mar 06, 2018 at 09:51:57PM +0100, Jakub Jelinek wrote:
> The C FE in multiple spots checks building_stmt_list_p () to decide if
> we are inside of parsing of functions or outside of that.
> Unfortunately, that breaks with add_debug_begin_stmt which pushes
> DEBUG_BEGIN_STMTs regardless of the scope it appears in; e.g. on the
> testcase below it pushes DEBUG_BEGIN_STMT already for the int a
> declaration in column 1 on line 5, and so with -g building_stmt_list_p ()
> is pretty much always true.
> Fixed by only pushing DEBUG_BEGIN_STMTs when the building_stmt_list_p ()
> predicate is true, they aren't really useful outside of functions anyway.
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?