From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luc Van Oostenryck Subject: Re: Sparse-LLVM issue compiling NULL pointers Date: Fri, 3 Mar 2017 06:35:57 +0100 Message-ID: <20170303053556.dvdbrx4pkm6jdilk@macpro.local> References: <20170228150956.moyfiyd5zf7tbeze@macbook.local> <20170302052124.fsqogvysufayy4to@macbook.local> <20170302135655.s742zcslis5r56if@macpro.local> <20170302160403.zz5efgh34jvjh5q5@macpro.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wm0-f48.google.com ([74.125.82.48]:36958 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983AbdCCFqQ (ORCPT ); Fri, 3 Mar 2017 00:46:16 -0500 Received: by mail-wm0-f48.google.com with SMTP id n11so7211290wma.0 for ; Thu, 02 Mar 2017 21:45:12 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Dibyendu Majumdar Cc: Linux-Sparse On Thu, Mar 02, 2017 at 06:41:35PM +0000, Dibyendu Majumdar wrote: > This seems spot on as by making change as below, the final assertion > failure went away. I have not yet checked the generated code but that > is next. > > case OP_ADD: > if (symbol_is_fp_type(C, insn->type)) > target = LLVMBuildFAdd(fn->builder, lhs, rhs, target_name); > else { > if (LLVMGetTypeKind(LLVMTypeOf(lhs)) == LLVMPointerTypeKind) { > target = LLVMBuildGEP(fn->builder, lhs, &rhs, 1, ""); > } > else if (LLVMGetTypeKind(LLVMTypeOf(lhs)) == LLVMPointerTypeKind) { Yes, this is what I meant but here you're testing twice the type of 'lhs'. One of the test should be on 'rhs'. Can you resend it in another thread once it's fixed? Thanks, Luc