linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 2/2] fix killing of converted loads
Date: Tue,  6 Feb 2018 20:41:43 +0100	[thread overview]
Message-ID: <20180206194143.1285-3-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20180206194143.1285-1-luc.vanoostenryck@gmail.com>

Converted loads are dead and can be removed but that
laos means that the address' usage need to be adjusted
which wasn't done.

Fix this by adding the missing kill_use().

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 flow.c                            | 1 +
 validation/optim/load-converted.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/flow.c b/flow.c
index d553df128..12fa62ed1 100644
--- a/flow.c
+++ b/flow.c
@@ -304,6 +304,7 @@ void convert_load_instruction(struct instruction *insn, pseudo_t src)
 {
 	convert_instruction_target(insn, src);
 	/* Turn the load into a no-op */
+	kill_use(&insn->src);
 	insn->opcode = OP_LNOP;
 	insn->bb = NULL;
 }
diff --git a/validation/optim/load-converted.c b/validation/optim/load-converted.c
index 010c6bc7b..7cbb53cf4 100644
--- a/validation/optim/load-converted.c
+++ b/validation/optim/load-converted.c
@@ -8,7 +8,6 @@ static int foo(int *p, int i)
 /*
  * check-name: load-converted
  * check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
  *
  * check-output-ignore
  * check-output-excludes: add\.
-- 
2.16.0


      parent reply	other threads:[~2018-02-06 19:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 19:41 [PATCH 0/2] fix usage in converted loads Luc Van Oostenryck
2018-02-06 19:41 ` [PATCH 1/2] add testcase " Luc Van Oostenryck
2018-02-06 19:41 ` Luc Van Oostenryck [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=20180206194143.1285-3-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.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: 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).