linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-sparse@vger.kernel.org, Jeff Garzik <jeff@garzik.org>
Subject: Re: sparse-llvm: pseudo_to_value: Assertion `sym->ident == ((void *)0)' failed
Date: Mon, 13 Feb 2012 15:34:29 +0200	[thread overview]
Message-ID: <CAOJsxLFnSKkfaeTKkoN-RM5iRfunmktwDUwDOtTjKQ-U_65SXg@mail.gmail.com> (raw)
In-Reply-To: <1329117459.2534.11.camel@pasglop>

On Mon, Feb 13, 2012 at 9:17 AM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> Hi folks !
>
> Haven't had a chance to investigate further today (and probably won't)
> so I'm shooting this here just in case ;-)
>
> I was tracking down what looks like an LLVM bug with sign extension from
> 1-bit integers while playing with llvmpipe (gallium llvm backend) and
> out of curiosity decided to look at what sparse generated when
> sign-extending a bool :-)
>
> So I added to my earlier hello.c some statements to that effect, and
> trying to compile it results in:
>
> sparse-llvm.c:311: pseudo_to_value: Assertion `sym->ident == ((void *)0)' failed.
>
> The new hello.c is:
>
> #include <stdio.h>
> #include <stdbool.h>
>
> int main(void)
> {
>        int i;
>        double f1,f2;
>        bool eq;
>
>        printf("Hello World !\n");
>
>        for (i = 0; i < 10; i ++)
>                printf("I can count to %d\n", i);
>
>        printf("f1=");
>        scanf("%f",&f1);
>        printf("f2=");
>        scanf("%f",&f2);
>
>        eq = f1 == f2;
>
>        printf("f1==f2: %d\n", (int)eq);
>        return 0;
> }

I can reproduce the issue with this minimal test case:

#include <stdio.h>

int main(int argc, char *argv[])
{
	float f;

	scanf("%f", &f);

	return 0;
}

It looks like we need to teach pseudo_to_value() about ident symbols.

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

      reply	other threads:[~2012-02-13 13:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13  7:17 sparse-llvm: pseudo_to_value: Assertion `sym->ident == ((void *)0)' failed Benjamin Herrenschmidt
2012-02-13 13:34 ` Pekka Enberg [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=CAOJsxLFnSKkfaeTKkoN-RM5iRfunmktwDUwDOtTjKQ-U_65SXg@mail.gmail.com \
    --to=penberg@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=jeff@garzik.org \
    --cc=linux-sparse@vger.kernel.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).