linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: "Sparse Mailing-list" <linux-sparse@vger.kernel.org>,
	"Pekka Enberg" <penberg@kernel.org>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
Subject: Re: Fwd: [problem] sparse llvm loop conditions
Date: Sat, 18 May 2013 20:42:03 +0200	[thread overview]
Message-ID: <20130518184203.GE3154@debian.debian> (raw)
In-Reply-To: <50312093.5050207@pobox.com>

Hi Jeff, Pekka,

On Sun, Aug 19, 2012 at 01:21:23PM -0400, Jeff Garzik wrote:
> Here is a testcase that should get into the mailing list archives...
> 
> 	Jeff
> 
> 
> 
> 
> -------- Original Message --------
> Subject: [problem] sparse llvm loop conditions
> Date: Wed, 23 Nov 2011 08:56:25 +0200
> From: Pekka Enberg <penberg@kernel.org>
> To: Jeff Garzik <jeff@garzik.org>
> 
> Hi Jeff,
> 
> Have you seen this already?
> 
> [penberg@tux sparse]$ cat loop.c
> struct list_node {
> 	struct list_node *next;
> };
> 
> int foo(struct list_node *node)
> {
> 	int ret = 0;
> 	while (node) {
> 		node = node->next;
> 		ret++;
> 	}
> 	return ret;
> }
> [penberg@tux sparse]$ ./sparse-llvm loop.c
> loop.c:5:5: warning: symbol 'foo' was not declared. Should it be static?
> sparse-llvm: Instructions.cpp:730: void llvm::BranchInst::AssertOK():
> Assertion `getCondition()->getType()->isIntegerTy(1) && "May only
> branch on boolean predicates!"' failed.
> Aborted
> 
>                                 Pekka

With my patchset of today, sparse-llvm compiles this code. It turned out
that struct accesses didn't work, because the address computed for
load/store instructions didn't have the right LLVM type.

[ On a side note, array access doesn't work yet. ]

regards,
Jonathan

  parent reply	other threads:[~2013-05-18 18:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOJsxLF351XvYE6Av3hxMsqXeu2nT4vRjbLgwNAguNLEfgLQvQ@mail.gmail.com>
2012-08-19 17:21 ` Fwd: [problem] sparse llvm loop conditions Jeff Garzik
2012-08-19 19:48   ` Jonathan Neuschäfer
2013-05-18 18:42   ` Jonathan Neuschäfer [this message]
2013-05-19  8:16     ` Pekka Enberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130518184203.GE3154@debian.debian \
    --to=j.neuschaefer@gmx.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=penberg@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).