diff options
Diffstat (limited to 'gcc/c-family/c-semantics.c')
-rw-r--r-- | gcc/c-family/c-semantics.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/c-family/c-semantics.c b/gcc/c-family/c-semantics.c index 3ceb714..cd872d8 100644 --- a/gcc/c-family/c-semantics.c +++ b/gcc/c-family/c-semantics.c @@ -76,6 +76,27 @@ pop_stmt_list (tree t) free_stmt_list (t); t = u; } + /* If the statement list contained a debug begin stmt and a + statement list, move the debug begin stmt into the statement + list and return it. */ + else if (!tsi_end_p (i) + && TREE_CODE (tsi_stmt (i)) == DEBUG_BEGIN_STMT) + { + u = tsi_stmt (i); + tsi_next (&i); + if (tsi_one_before_end_p (i) + && TREE_CODE (tsi_stmt (i)) == STATEMENT_LIST) + { + tree l = tsi_stmt (i); + tsi_prev (&i); + tsi_delink (&i); + tsi_delink (&i); + i = tsi_start (l); + free_stmt_list (t); + t = l; + tsi_link_before (&i, u, TSI_SAME_STMT); + } + } } return t; |