Re: Fwd: [problem] sparse llvm loop conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 18, 2013 at 9:42 PM, Jonathan Neuschäfer
<j.neuschaefer@xxxxxxx> wrote:
> 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@xxxxxxxxxx>
>> To: Jeff Garzik <jeff@xxxxxxxxxx>
>>
>> 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
>
> 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.

Indeed it does! :-)

Just in case people want to try it out, the code is in my llvm/core branch here:

https://github.com/penberg/sparse-llvm/tree/llvm/core

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




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux