public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1474] [Ada] Remove redundant guards in detection of unreachable code Date: Tue, 5 Jul 2022 08:29:22 +0000 (GMT) [thread overview] Message-ID: <20220705082922.A02BA3858036@sourceware.org> (raw) https://gcc.gnu.org/g:21d6ec4579056c97953cb22e99056e6e9a5450c4 commit r13-1474-g21d6ec4579056c97953cb22e99056e6e9a5450c4 Author: Piotr Trojanek <trojanek@adacore.com> Date: Tue May 31 00:29:28 2022 +0200 [Ada] Remove redundant guards in detection of unreachable code Routine Check_Unreachable_Code is only called on nodes belonging to a list of statements (and it wouldn't make sense to call it on anything else). gcc/ada/ * sem_ch5.adb (Check_Unreachable_Code): Remove redundant guard; the call to Present wasn't needed either. Diff: --- gcc/ada/sem_ch5.adb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 1f3ea556235..bb1e7b9cede 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -4398,7 +4398,7 @@ package body Sem_Ch5 is P : Node_Id; begin - if Is_List_Member (N) and then Comes_From_Source (N) then + if Comes_From_Source (N) then Nxt := Original_Node (Next (N)); -- Skip past pragmas @@ -4415,8 +4415,7 @@ package body Sem_Ch5 is -- Otherwise see if we have a real statement following us - elsif Present (Nxt) - and then Comes_From_Source (Nxt) + elsif Comes_From_Source (Nxt) and then Is_Statement (Nxt) then -- Special very annoying exception. If we have a return that
reply other threads:[~2022-07-05 8:29 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220705082922.A02BA3858036@sourceware.org \ --to=pmderodat@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).