From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dibyendu Majumdar Subject: sparse-llvm incorrect handling of function pointers Date: Fri, 10 Mar 2017 14:23:26 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-io0-f178.google.com ([209.85.223.178]:33480 "EHLO mail-io0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937877AbdCJOX2 (ORCPT ); Fri, 10 Mar 2017 09:23:28 -0500 Received: by mail-io0-f178.google.com with SMTP id f84so47967805ioj.0 for ; Fri, 10 Mar 2017 06:23:27 -0800 (PST) Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Linux-Sparse Hi, This example fails: extern int (*f) (int); int main(int argc, const char *argv[]) { if (f) { return (*f)(6); } } The linearized output is: main: .L0: load.64 %r1(f) <- 0[f] br %r1(f), .L1, .L3 .L1: load %r3 <- 0[%r1(f)] call.32 %r4 <- %r3, $6 br .L3 .L3: ret.32 %r4 It is the second load that is failing. Am investigating the cause - it seems something to do with calc_memop_addr(). Regards Dibyendu