* [PATCH 0/2] fix usage in converted loads
@ 2018-02-06 19:41 Luc Van Oostenryck
2018-02-06 19:41 ` [PATCH 1/2] add testcase " Luc Van Oostenryck
2018-02-06 19:41 ` [PATCH 2/2] fix killing of " Luc Van Oostenryck
0 siblings, 2 replies; 3+ messages in thread
From: Luc Van Oostenryck @ 2018-02-06 19:41 UTC (permalink / raw)
To: linux-sparse; +Cc: Luc Van Oostenryck
This patch contains a fix for the usage of the address pseudo
not being adjusted after conversion.
Luc Van Oostenryck (2):
add testcase converted loads
fix killing of converted loads
flow.c | 1 +
validation/optim/load-converted.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
create mode 100644 validation/optim/load-converted.c
--
2.16.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] add testcase converted loads
2018-02-06 19:41 [PATCH 0/2] fix usage in converted loads Luc Van Oostenryck
@ 2018-02-06 19:41 ` Luc Van Oostenryck
2018-02-06 19:41 ` [PATCH 2/2] fix killing of " Luc Van Oostenryck
1 sibling, 0 replies; 3+ messages in thread
From: Luc Van Oostenryck @ 2018-02-06 19:41 UTC (permalink / raw)
To: linux-sparse; +Cc: Luc Van Oostenryck
More specifically, a testcase show the wrong usage
for the address of a converted load.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
validation/optim/load-converted.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 validation/optim/load-converted.c
diff --git a/validation/optim/load-converted.c b/validation/optim/load-converted.c
new file mode 100644
index 000000000..010c6bc7b
--- /dev/null
+++ b/validation/optim/load-converted.c
@@ -0,0 +1,15 @@
+static int foo(int *p, int i)
+{
+ int a = p[i];
+ int b = p[i];
+ return (a - b);
+}
+
+/*
+ * 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] fix killing of converted loads
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
1 sibling, 0 replies; 3+ messages in thread
From: Luc Van Oostenryck @ 2018-02-06 19:41 UTC (permalink / raw)
To: linux-sparse; +Cc: Luc Van Oostenryck
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-06 19:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/2] fix killing of " Luc Van Oostenryck
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).