aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-03-06 21:57:30 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-03-06 21:57:30 +0100
commit849bbdb99c5c8b1a97041a533c69bbaf8376c975 (patch)
treeb4378dbbf14b30df7e19093c232a5f99910a84de /gcc/c/c-parser.c
parent2728bf8f131f42c43cc4b309bf4d949a0bea601d (diff)
downloadgcc-849bbdb99c5c8b1a97041a533c69bbaf8376c975.zip
gcc-849bbdb99c5c8b1a97041a533c69bbaf8376c975.tar.gz
gcc-849bbdb99c5c8b1a97041a533c69bbaf8376c975.tar.bz2
re PR c/84721 (ICE in c_push_function_context, at c-decl.c:9667)
PR c/84721 * c-parser.c (add_debug_begin_stmt): Don't add DEBUG_BEGIN_STMT if !building_stmt_list_p (). * gcc.dg/pr84721.c: New test. From-SVN: r258302
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r--gcc/c/c-parser.c3
1 files changed, 2 insertions, 1 deletions
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);