Mercurial > hg > CbC > CbC_examples
changeset 24:19160c497905
lj_as2: can compile -O2 (can't execute)
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 31 Jan 2016 19:37:36 +0900 |
parents | facab2ddc380 |
children | 6324b8df04f1 |
files | conv1/conv1.c ljtes/a.out ljtes/lj ljtes/ljtes_as2.c |
diffstat | 4 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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));
--- 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; }