linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	linux-sparse@vger.kernel.org
Subject: Re: [PATCH 2/2] fix rem_usage()
Date: Mon, 28 Dec 2020 17:22:36 +0000	[thread overview]
Message-ID: <52a111f5-aea4-d705-f0c3-d71ecb2226dc@ramsayjones.plus.com> (raw)
In-Reply-To: <20201227092759.30999-3-luc.vanoostenryck@gmail.com>



On 27/12/2020 09:27, Luc Van Oostenryck wrote:
> rem_usage() is used to remove an element from a def-use chain. Optionally,

Hmm, rename this to 'remove_usage()' at the same time?

ATB,
Ramsay Jones

> if the chain become empty, the defining instruction can also be killed.
> 
> This optional part is currently be done on all pseudos but only those
> having a definition should be concerned.
> 
> Fix this by adding a check so that only PSEUDO_REGs and PSEUDO_PHIs are killed.
> 
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
>  simplify.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/simplify.c b/simplify.c
> index a877b693b610..12482d787189 100644
> --- a/simplify.c
> +++ b/simplify.c
> @@ -271,7 +271,7 @@ static inline void rem_usage(pseudo_t p, pseudo_t *usep, int kill)
>  {
>  	if (has_use_list(p)) {
>  		delete_pseudo_user_list_entry(&p->users, usep, 1);
> -		if (kill && !p->users)
> +		if (kill && !p->users && has_definition(p))
>  			kill_instruction(p->def);
>  	}
>  }
> 

  reply	other threads:[~2020-12-28 17:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27  9:27 [PATCH 0/2] fix rem_usage() Luc Van Oostenryck
2020-12-27  9:27 ` [PATCH 1/2] add helper has_definition() Luc Van Oostenryck
2020-12-28 17:20   ` Ramsay Jones
2020-12-27  9:27 ` [PATCH 2/2] fix rem_usage() Luc Van Oostenryck
2020-12-28 17:22   ` Ramsay Jones [this message]
2020-12-28 21:39     ` Luc Van Oostenryck
2020-12-28 22:09       ` Ramsay Jones
2020-12-28 22:30         ` Ramsay Jones

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=52a111f5-aea4-d705-f0c3-d71ecb2226dc@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@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 NNTP newsgroup(s).