linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dibyendu Majumdar <mobile@majumdar.org.uk>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: Another code snippet that Sparse has problems with
Date: Thu, 7 Sep 2017 11:18:10 +0100	[thread overview]
Message-ID: <CACXZuxceJuvMPZKZbLXDrzsXWK2a9A8M8L4rFaJ0f-s7vL-1vQ@mail.gmail.com> (raw)
In-Reply-To: <20170907013101.f6d4eeftkolbsjr5@ltop.local>

Hi Luc,

On 7 September 2017 at 02:31, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> 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.

Regards
Dibyendu

  reply	other threads:[~2017-09-07 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06 23:05 Another code snippet that Sparse has problems with Dibyendu Majumdar
2017-09-07  1:31 ` Luc Van Oostenryck
2017-09-07 10:18   ` Dibyendu Majumdar [this message]
2017-09-07 20:22     ` Luc Van Oostenryck

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=CACXZuxceJuvMPZKZbLXDrzsXWK2a9A8M8L4rFaJ0f-s7vL-1vQ@mail.gmail.com \
    --to=mobile@majumdar.org.uk \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    /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).