From: "Christopher Li" <sparse@chrisli.org>
To: Pavel Roskin <proski@gnu.org>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [RFC PATCH] Fix crash in linearize_compound_statement()
Date: Mon, 7 Apr 2008 23:05:09 -0700 [thread overview]
Message-ID: <70318cbf0804072305x9b1dacdrd25bca5094bb23d5@mail.gmail.com> (raw)
In-Reply-To: <1207631657.3209.13.camel@rd>
On Mon, Apr 7, 2008 at 10:14 PM, Pavel Roskin <proski@gnu.org> wrote:
>
> I should have been more clear. Last time I was carried away by some
> strange messages about "return" and labels, which seemed really weird to
> me, but less so after your explanation.
>
> This example is made from the same original source, but this time I
> concentrated on the crash, because that's the thing that cannot be
> justified by any bad code.
I understand that you have your source code which sparse choked on
fixed. Good.
I am actually complaining your fix to sparse itself. It is not good enough.
You fix it in the linearize stage. That is already too late.
You should fix it in the parse and type evaluate stage, before it even reach
to the linearizer.
>
>
> > I agree sparse should not assert on it, but not like this.
>
> I don't quite understand why sparse is getting in this situation, but
Exactly. That is because you try to linearize the exact same function
twice due to the "typeof(bar)". Linearize the same function twice is just
plain wrong. It should never happen. Your patch just covers up the real problem
instead of fixing it.
> That's fixed, of course. And many other problems are fixed too, some of
> which are user visible. I really appreciate the usefulness of sparse.
I mean the fix in the sparse source code, not the source code which sparse
is checking. You should change sparse, when it do "typeof(function) varname",
give it a warning and skip this "varname" node all together. Later in the
linearize stage, it will not linearize the same function twice.
What your patch does is actually allowing sparse linearized a function twice.
That is going to mess up the user-define chain very badly (e.g. the PHI node
usage problem you are seeing.)
Chris
prev parent reply other threads:[~2008-04-08 6:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-07 20:45 [RFC PATCH] Fix crash in linearize_compound_statement() Pavel Roskin
2008-04-07 21:55 ` Christopher Li
2008-04-08 5:14 ` Pavel Roskin
2008-04-08 6:05 ` 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=70318cbf0804072305x9b1dacdrd25bca5094bb23d5@mail.gmail.com \
--to=sparse@chrisli.org \
--cc=linux-sparse@vger.kernel.org \
--cc=proski@gnu.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).