From: Christopher Li <sparse@chrisli.org>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>,
Dibyendu Majumdar <mobile@majumdar.org.uk>
Subject: Re: [PATCH] fix expansion of constant bitfield dereference
Date: Mon, 21 Aug 2017 12:46:00 -0400 [thread overview]
Message-ID: <CANeU7QkWUDxpmm2ZsAdNsa4OsP3xGUhyJfRaZYRRoWU_2orghQ@mail.gmail.com> (raw)
In-Reply-To: <CAMHZB6FaVescSVFrZK4x_=47Rs_zF=WNbgbSWhjgHhqUK9FXEw@mail.gmail.com>
On Mon, Aug 21, 2017 at 12:14 PM, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
> On Mon, Aug 21, 2017 at 6:06 PM, Christopher Li <sparse@chrisli.org> wrote:
>>
>> I am referenitng to your email reply to Dibyendu:
>>
>> ===========================
>> It's a very surprising bug. It's not a linearization or
>> an optimization bug as the AST is already wrong.
>> With a simpler test case, like:
>> struct s {
>> char a:4;
>> char b:4;
>> };
>>
>> int foo(void)
>> {
>> struct s x = { .a = 2, .b = 4 };
>>
>> return x.b;
>> }
>>
>> you can see that the linearization produce correct
>> code for the initializer.
>> You can also see that the return statement to be
>> linearized is something like
>> STMT_RETURN
>> ret_value: EXPR_VALUE (value = 2)
>
>
> It's precisely this bug that this patch fixes.
Oh, I see. I misunderstand what bug the patch fix.
Let me go back to read it again.
Sorry about that.
Thanks for the explain.
Chris
prev parent reply other threads:[~2017-08-21 16:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-20 22:16 [PATCH] fix expansion of constant bitfield dereference Luc Van Oostenryck
2017-08-20 22:19 ` Dibyendu Majumdar
2017-08-21 12:26 ` Christopher Li
2017-08-21 13:32 ` Dibyendu Majumdar
2017-08-21 13:41 ` Christopher Li
2017-08-21 13:42 ` Luc Van Oostenryck
2017-08-21 16:06 ` Christopher Li
2017-08-21 16:14 ` Luc Van Oostenryck
2017-08-21 16:46 ` Christopher Li [this message]
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=CANeU7QkWUDxpmm2ZsAdNsa4OsP3xGUhyJfRaZYRRoWU_2orghQ@mail.gmail.com \
--to=sparse@chrisli.org \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=mobile@majumdar.org.uk \
/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).