All of lore.kernel.org
 help / color / mirror / Atom feed
* sparse-llvm incorrect handling of function pointers
@ 2017-03-10 14:23 Dibyendu Majumdar
  2017-03-10 17:44 ` Luc Van Oostenryck
  0 siblings, 1 reply; 8+ messages in thread
From: Dibyendu Majumdar @ 2017-03-10 14:23 UTC (permalink / raw)
  To: Linux-Sparse

Hi,

This example fails:

extern int (*f) (int);
int main(int argc, const char *argv[]) {
 if (f) {
  return (*f)(6);
 }
}

The linearized output is:

main:
.L0:
        <entry-point>
        load.64     %r1(f) <- 0[f]
        br          %r1(f), .L1, .L3
.L1:
        load        %r3 <- 0[%r1(f)]
        call.32     %r4 <- %r3, $6
        br          .L3
.L3:
        ret.32      %r4

It is the second load that is failing. Am investigating the cause - it
seems something to do with calc_memop_addr().

Regards
Dibyendu

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-26  2:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-10 14:23 sparse-llvm incorrect handling of function pointers Dibyendu Majumdar
2017-03-10 17:44 ` Luc Van Oostenryck
2017-03-10 18:13   ` Dibyendu Majumdar
2017-03-11 11:54     ` Luc Van Oostenryck
2017-03-11 11:56       ` Dibyendu Majumdar
2017-03-11 11:58     ` [PATCH] llvm: add script to display the deserialized LLVM IR Luc Van Oostenryck
2017-04-25 20:43       ` Christopher Li
2017-04-26  2:11         ` Luc Van Oostenryck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.