* sparse-llvm potential error in linearized output
@ 2017-03-12 13:04 Dibyendu Majumdar
[not found] ` <CA+55aFzqZozMb0A4HMJ8UTNEV+LqHWXQsSBrPLMts_vkxsKtQA@mail.gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Dibyendu Majumdar @ 2017-03-12 13:04 UTC (permalink / raw)
To: Linux-Sparse
I have the following test:
extern int printf(const char *, ...);
static char *randomletters = "agqwewbxklpfgytuorz";
int main(void)
{
int i;
for (i = 0; i < 20; i++) {
int key;
key = randomletters[i];
printf("Inserting %d\n", key);
}
return 0;
}
The linearized output is:
main:
.L0:
<entry-point>
phisrc.32 %phi4(i) <- $0
br .L4
.L4:
phi.32 %r1(i) <- %phi4(i), %phi5(i)
setlt.32 %r2 <- %r1(i), $20
br %r2, .L1, .L5
.L1:
load.64 %r3 <- 0[randomletters]
scast.64 %r5 <- (32) %r1(i)
add.64 %r6 <- %r3, %r5
load.8 %r7 <- 0[%r6]
scast.32 %r8 <- (8) %r7
symaddr.64 %r9 <- <anon symbol:0000020914372028>
call.32 %r11 <- printf, %r9, %r8
add.32 %r13 <- %r1(i), $1
phisrc.32 %phi5(i) <- %r13
br .L4
.L5:
ret.32 $0
The following instruction looks incorrect to me:
load.64 %r3 <- 0[randomletters]
Thanks and Regards
Dibyendu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-12 16:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-12 13:04 sparse-llvm potential error in linearized output Dibyendu Majumdar
[not found] ` <CA+55aFzqZozMb0A4HMJ8UTNEV+LqHWXQsSBrPLMts_vkxsKtQA@mail.gmail.com>
[not found] ` <CA+55aFxuovvof9UhSAnQMuBjEr0xd8qxbDSV1cpi_ubWx386Zg@mail.gmail.com>
[not found] ` <CA+55aFyaW01tfG5LP+aeV-hSppzhqW7gCV7EM2OmxbJyg0cBXw@mail.gmail.com>
2017-03-12 16:52 ` Dibyendu Majumdar
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).