X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gcc%2Ffortran%2Ffrontend-passes.c;h=92a3f8fb3b273f5bc7eb500cfc36a1fdbdb05bb7;hb=3d3b81932db70022b4479171a030006a78e65299;hp=b20dabbd33b24d432806b9574b7f992c1c52eef7;hpb=78900a5421c526fe58475d686673d8929629ecba;p=gcc.git diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index b20dabbd33b..92a3f8fb3b2 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -271,6 +271,16 @@ create_var (gfc_expr * e) inserted_block->ext.block.assoc = NULL; ns->code = *current_code; + + /* If the statement has a label, make sure it is transferred to + the newly created block. */ + + if ((*current_code)->here) + { + inserted_block->here = (*current_code)->here; + (*current_code)->here = NULL; + } + inserted_block->next = (*current_code)->next; changed_statement = &(inserted_block->ext.block.ns->code); (*current_code)->next = NULL;