public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "G.T." <gntengetta@gmail.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Possible dead code in file lra-spills.cc
Date: Thu, 15 Dec 2022 10:21:52 -0500	[thread overview]
Message-ID: <CAOBJmmvOwUL_2K=tbvkwx3779Uw3TQPWXp6pFiCLyxjGX1SXJg@mail.gmail.com> (raw)
In-Reply-To: <B2CABEE9-73EE-4BBA-A66E-19D125EB1FDE@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

Ok.

And as you point out it is redundant code rather than dead code, to be
precise.

On Wed, Dec 14, 2022, 1:47 PM Richard Biener <richard.guenther@gmail.com>
wrote:

>
>
> > Am 14.12.2022 um 18:28 schrieb G.T. via Gcc <gcc@gcc.gnu.org>:
> >
> > At line 276, lra_assert (spill_class != NO_REGS); would trigger
> > whenever execution reached here with spill_class equal to NO_REGS.
> > Seems to me that would never happen. Because one of the conditions in
> > the if statement right above it (line 265) catches spill_class ==
> > NO_REGS and causes the rest of the for loop to be skipped by executing
> > continue in the consequent of the if. So lra_assert never sees
> > spill_class == NO_REGS. That makes line 276 dead code, right?
>
> Sometimes this serves as documentation to make the code more obvious to
> read.  Depends on the distance of the redundant check.
>
> Richard
>
>
> > Thanks.
> > GT.
>

      reply	other threads:[~2022-12-15 15:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-17  9:25 G.T.
2022-12-14 18:46 ` Richard Biener
2022-12-15 15:21   ` G.T. [this message]

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='CAOBJmmvOwUL_2K=tbvkwx3779Uw3TQPWXp6pFiCLyxjGX1SXJg@mail.gmail.com' \
    --to=gntengetta@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    /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: link
Be 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).