From patchwork Sat May 18 17:52:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 2589101 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 83ECE3FD85 for ; Sat, 18 May 2013 17:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752157Ab3ERRwm (ORCPT ); Sat, 18 May 2013 13:52:42 -0400 Received: from mout.gmx.net ([212.227.15.15]:50098 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718Ab3ERRwl (ORCPT ); Sat, 18 May 2013 13:52:41 -0400 Received: from mailout-de.gmx.net ([10.1.76.10]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0Lobhc-1U1eH70RsQ-00gUsm for ; Sat, 18 May 2013 19:52:39 +0200 Received: (qmail invoked by alias); 18 May 2013 17:52:38 -0000 Received: from dslb-084-060-248-207.pools.arcor-ip.net (EHLO debian.debian) [84.60.248.207] by mail.gmx.net (mp010) with SMTP; 18 May 2013 19:52:38 +0200 X-Authenticated: #41721828 X-Provags-ID: V01U2FsdGVkX1+JW4A/fb2Je34idLIgm8s7mElQpbETL9Eb1UcBxc sw2p9Kt4UaJhOx From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= To: linux-sparse@vger.kernel.org Cc: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Pekka Enberg , Christopher Li , Jeff Garzik , Linus Torvalds , Xi Wang Subject: [PATCH 1/4] sparse, llvm: Fix resulting type of store address calculations Date: Sat, 18 May 2013 19:52:04 +0200 Message-Id: <1368899527-2350-1-git-send-email-j.neuschaefer@gmx.net> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org Use the fix from d5bd3662 ("sparse, llvm: Fix type of loaded values"). Cc: Pekka Enberg Cc: Christopher Li Cc: Jeff Garzik Cc: Linus Torvalds Cc: Xi Wang Signed-off-by: Jonathan Neuschäfer --- 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 + */