public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] move unreachable user labels to entry point Date: Sat, 10 Jul 2021 00:08:45 +0000 (GMT) [thread overview] Message-ID: <20210710000845.77ACE385E440@sourceware.org> (raw) https://gcc.gnu.org/g:c377d31b12ff58322274d1ae321c8ae880bf74c6 commit c377d31b12ff58322274d1ae321c8ae880bf74c6 Author: Alexandre Oliva <oliva@adacore.com> Date: Fri Jul 9 19:54:44 2021 -0300 move unreachable user labels to entry point Diff: --- gcc/tree-cfg.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 1f0f4a2c6eb..f6f005f10a9 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -2300,13 +2300,11 @@ remove_bb (basic_block bb) FORCED_LABEL (gimple_label_label (label_stmt)) = 1; } - new_bb = bb->prev_bb; - /* Don't move any labels into ENTRY block. */ - if (new_bb == ENTRY_BLOCK_PTR_FOR_FN (cfun)) - { - new_bb = single_succ (new_bb); - gcc_assert (new_bb != bb); - } + /* We have to move the unreachable label somewhere. + Moving it to the entry block makes sure it's moved at + most once, and avoids messing with anonymous landing + pad labels. */ + new_bb = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun)); if ((unsigned) bb->index < bb_to_omp_idx.length () && ((unsigned) new_bb->index >= bb_to_omp_idx.length () || (bb_to_omp_idx[bb->index] @@ -2316,7 +2314,6 @@ remove_bb (basic_block bb) into the right OMP region. */ unsigned int i; int idx; - new_bb = NULL; FOR_EACH_VEC_ELT (bb_to_omp_idx, i, idx) if (i >= NUM_FIXED_BLOCKS && idx == bb_to_omp_idx[bb->index] @@ -2325,11 +2322,6 @@ remove_bb (basic_block bb) new_bb = BASIC_BLOCK_FOR_FN (cfun, i); break; } - if (new_bb == NULL) - { - new_bb = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun)); - gcc_assert (new_bb != bb); - } } new_gsi = gsi_after_labels (new_bb); gsi_remove (&i, false);
next reply other threads:[~2021-07-10 0:08 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-10 0:08 Alexandre Oliva [this message] -- strict thread matches above, loose matches on Subject: below -- 2021-07-10 9:43 Alexandre Oliva 2021-06-28 15:42 Alexandre Oliva
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210710000845.77ACE385E440@sourceware.org \ --to=aoliva@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).