All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] sparse, llvm: Fix resulting type of store address calculations
@ 2013-05-18 17:52 Jonathan Neuschäfer
  2013-05-18 17:52 ` [PATCH 2/4] sparse, llvm: de-duplicate load/store address calculation code Jonathan Neuschäfer
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jonathan Neuschäfer @ 2013-05-18 17:52 UTC (permalink / raw)
  To: linux-sparse
  Cc: Jonathan Neuschäfer, Pekka Enberg, Christopher Li,
	Jeff Garzik, Linus Torvalds, Xi Wang

Use the fix from d5bd3662 ("sparse, llvm: Fix type of loaded values").

Cc: Pekka Enberg <penberg@kernel.org>
Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---
 sparse-llvm.c                   |    2 +-
 validation/backend/store-type.c |   12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 validation/backend/store-type.c

diff --git a/sparse-llvm.c b/sparse-llvm.c
index 6f2fbd6..837a96f 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -640,7 +640,7 @@ static void output_op_store(struct function *fn, struct instruction *insn)
 
 	/* convert address back to pointer */
 	addr = LLVMBuildIntToPtr(fn->builder, addr_i,
-				 LLVMPointerType(int_type, 0), "addr");
+				 LLVMTypeOf(src_p), "addr");
 
 	target_in = pseudo_to_value(fn, insn, insn->target);
 
diff --git a/validation/backend/store-type.c b/validation/backend/store-type.c
new file mode 100644
index 0000000..9e2ce73
--- /dev/null
+++ b/validation/backend/store-type.c
@@ -0,0 +1,12 @@
+struct foo;
+static struct foo *var;
+
+static void set(struct foo *f)
+{
+       var = f;
+}
+
+/*
+ * check-name: Type of stored objects
+ * check-command: ./sparsec -c $file -o tmp.o
+ */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-05-19  8:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-18 17:52 [PATCH 1/4] sparse, llvm: Fix resulting type of store address calculations Jonathan Neuschäfer
2013-05-18 17:52 ` [PATCH 2/4] sparse, llvm: de-duplicate load/store address calculation code Jonathan Neuschäfer
2013-05-18 17:52 ` [PATCH 3/4] sparse, llvm: base load/store address type on insn_symbol_type() Jonathan Neuschäfer
2013-05-18 22:45   ` Xi Wang
2013-05-19  0:17     ` Jonathan Neuschäfer
2013-05-18 17:52 ` [PATCH 4/4] sparse, llvm: add a struct access test case Jonathan Neuschäfer
2013-05-19  8:01 ` [PATCH 1/4] sparse, llvm: Fix resulting type of store address calculations Pekka Enberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.