diff options
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index f0fd33e..599ffa2 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2018-03-06 Jakub Jelinek <jakub@redhat.com> + + PR c/84721 + * c-parser.c (add_debug_begin_stmt): Don't add DEBUG_BEGIN_STMT if + !building_stmt_list_p (). + 2018-02-13 Richard Sandiford <richard.sandiford@linaro.org> PR c/84305 diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 5e3512a..945838c 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -1654,7 +1654,8 @@ static void c_finish_oacc_routine (struct oacc_routine_data *, tree, bool); static void add_debug_begin_stmt (location_t loc) { - if (!MAY_HAVE_DEBUG_MARKER_STMTS) + /* Don't add DEBUG_BEGIN_STMTs outside of functions, see PR84721. */ + if (!MAY_HAVE_DEBUG_MARKER_STMTS || !building_stmt_list_p ()) return; tree stmt = build0 (DEBUG_BEGIN_STMT, void_type_node); |