# HG changeset patch # User Kaito Tokumori # Date 1454236656 -32400 # Node ID 19160c497905ec213785726f1e592c7785197053 # Parent facab2ddc380c33854c779befba3d0602954b8c3 lj_as2: can compile -O2 (can't execute) diff -r facab2ddc380 -r 19160c497905 conv1/conv1.c --- a/conv1/conv1.c Sat Jan 30 03:40:06 2016 +0900 +++ b/conv1/conv1.c Sun Jan 31 19:37:36 2016 +0900 @@ -38,7 +38,6 @@ /* straight conversion case (1) */ - struct cont_interface { // General Return Continuation __code (*ret)(int,stack); }; @@ -54,6 +53,7 @@ int i_,k_,j_; }; + __code f_g0(int i,int k,stack sp) { // Caller struct f_g0_interface *c = (struct f_g0_interface *)(sp -= sizeof(struct f_g0_interface)); diff -r facab2ddc380 -r 19160c497905 ljtes/a.out Binary file ljtes/a.out has changed diff -r facab2ddc380 -r 19160c497905 ljtes/lj Binary file ljtes/lj has changed diff -r facab2ddc380 -r 19160c497905 ljtes/ljtes_as2.c --- a/ljtes/ljtes_as2.c Sat Jan 30 03:40:06 2016 +0900 +++ b/ljtes/ljtes_as2.c Sun Jan 31 19:37:36 2016 +0900 @@ -29,8 +29,8 @@ int calc(int n){ - void *env = ({ - struct __CbC_env __CbC_environment; + volatile void *env = ({ + volatile struct __CbC_env __CbC_environment; env = &__CbC_environment; jmp_buf env_buf; int retval; @@ -41,7 +41,7 @@ } &__CbC_environment; }); - goto factorial(n,1,n,print,env); + goto factorial(n,1,n,print,(void*)env); return 0; } @@ -66,7 +66,7 @@ "movq %%rsp, 0x10(%%rdi);" // set stack pointer "movl $0, %%eax;" // set return value "jmpq *0x8(%%rdi);" // return - :"+D"(env)::"rax","r11"); + :"+D"(env)::"rax"); return 0; }