From 4b7f02c09710b379a706708ae5880a1811519539 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 30 Apr 2019 11:02:42 +0200 Subject: isel fix for amd64 memory stores The value argument of store instructions was handled incorrectly. --- test/conaddr.ssa | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/conaddr.ssa b/test/conaddr.ssa index 43177ba..9e24d49 100644 --- a/test/conaddr.ssa +++ b/test/conaddr.ssa @@ -34,6 +34,13 @@ function l $f3(l %o) { ret %addr } +export +function $f4() { +@start + storel $p, $p + ret +} + export function $writeto0() { @start @@ -45,13 +52,14 @@ function $writeto0() { # #include # #include # char a[] = "qbe rocks"; +# void *p; # int ok; # extern unsigned f0(long), f1(long), f2(long, long); # extern char *f3(long); -# extern void writeto0(); +# extern void f4(), writeto0(); # void h(int sig, siginfo_t *si, void *unused) { # ok += si->si_addr == 0; -# exit(!(ok == 5)); +# exit(!(ok == 6)); # } # int main() { # struct sigaction sa = {.sa_flags=SA_SIGINFO, .sa_sigaction=h}; @@ -60,6 +68,8 @@ function $writeto0() { # ok += f1((long)a-5) == 'o'; # ok += f2(4, 2) == 's'; # ok += *f3(0) == 'q'; +# f4(); +# ok += p == &p; # writeto0(); /* will segfault */ # } # <<< -- cgit 1.4.1