* sparse-llvm: pseudo_to_value: Assertion `sym->ident == ((void *)0)' failed
@ 2012-02-13 7:17 Benjamin Herrenschmidt
2012-02-13 13:34 ` Pekka Enberg
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2012-02-13 7:17 UTC (permalink / raw)
To: linux-sparse
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;
}
Cheers,
Ben.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: sparse-llvm: pseudo_to_value: Assertion `sym->ident == ((void *)0)' failed
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
0 siblings, 0 replies; 2+ messages in thread
From: Pekka Enberg @ 2012-02-13 13:34 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linux-sparse, Jeff Garzik
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-13 13:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).