Re: Another code snippet that Sparse has problems with

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

 



On Thu, Sep 7, 2017 at 12:18 PM, Dibyendu Majumdar
<mobile@xxxxxxxxxxxxxxx> wrote:
> Hi Luc,
>
> On 7 September 2017 at 02:31, Luc Van Oostenryck
> <luc.vanoostenryck@xxxxxxxxx> wrote:
>> On Thu, Sep 07, 2017 at 12:05:58AM +0100, Dibyendu Majumdar wrote:
>>> I recently found another test case that fails:
>>>
>>> static int test_do(void) {
>>>     int a = 0;
>>>     int count = 27;
>>>     switch (count % 8) {
>>>     case 0: do {  a++;
>>>     case 7:       a++;
>>>     case 6:       a++;
>>>     case 5:       a++;
>>>     case 4:       a++;
>>>     case 3:       a++;
>>>     case 2:       a++;
>>>     case 1:       a++;
>>>             } while ((count -= 8) > 0);
>>>     }
>>>     if (27 != a) return 1;
>>>     return 0;
>>> }
>>
>
> What's interesting is that I find that this code compiles OK with the
> old SSA implementation, with or without single store short-cut, and
> with out without simplifications.
>
> But the newssa implementation ( your original sssa-mini) fails when
> simplifications are turned on.

It's possible but it's just a coincidence. The code generated by the rc5
version is wrong and rc5 or newssa need the patch I send because of
what is done on phi-node operands in insert_branch()/remove_parent().

-- Luc
--
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