changeset 47:e07c7952f237

add sources
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Wed, 23 Nov 2011 02:27:44 +0900
parents db63cc25d890
children f023b374823b
files Paper/source/#factorial.cbc# Paper/source/cbc_replace_arguments.c Paper/source/conv1.c Paper/source/conv1.c~ Paper/source/factorial.cbc~ Paper/source/regi-id.c Paper/source/regi-node.c Paper/source/regi-node.c~ Paper/source/reswords.c Paper/source/reswords.c~ Paper/source/return.c Paper/source/rid-goto.c Paper/source/rid-goto.c~ Paper/source/rid_goto.c Paper/source/rid_goto.c~ Paper/source/tail_call_flag.c Paper/source/tail_call_flag.c~
diffstat 17 files changed, 729 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/#factorial.cbc#	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,24 @@
+__code print_factorial(int prod)
+{
+  printf("factorial = %d\n",prod);
+  exit(0);
+}
+__code factorial0(int prod, int x)
+{
+  if ( x >= 1) {
+    goto factorial0(prod*x, x-1);
+  }else{
+    goto print_factorial(prod);
+  }
+}
+__code factorial(int x)
+{
+  goto factorial0(1, x);
+}
+int main(int argc, char **argv)
+{
+  int i;
+  i = atoi(argv[1]);
+
+  goto factorial(i);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/cbc_replace_arguments.c	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,35 @@
+static tree
+cbc_replace_arguments (location_t loc, tree call)
+{
+  tree arg;
+  tree fn;
+  tree tmp_decl;
+  int i=0;
+  call_expr_arg_iterator iter;
+
+  fn = CALL_EXPR_FN (call);
+  if ( TREE_CODE (fn)==PARM_DECL || !TREE_CONSTANT (fn) )
+    {
+      tmp_decl = build_decl (loc, VAR_DECL, NULL_TREE, TREE_TYPE(fn));
+      pushdecl (tmp_decl);
+
+      add_stmt (build_modify_expr (loc, tmp_decl, NULL_TREE, NOP_EXPR, loc, fn, NULL_TREE));
+      CALL_EXPR_FN (call) = tmp_decl;
+    }
+
+  FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
+    {
+      /* if ( !CONSTANT_CLASS_P (arg) && !VAR_OR_FUNCTION_DECL_P (arg) ) */
+      if ( TREE_CODE (arg)==PARM_DECL || !TREE_CONSTANT (arg) )
+        {
+          tmp_decl = build_decl (loc, VAR_DECL, NULL_TREE, TREE_TYPE(arg));
+          pushdecl (tmp_decl);
+
+          add_stmt (build_modify_expr (loc, tmp_decl, NULL_TREE, NOP_EXPR, loc, arg, NULL_TREE));
+          CALL_EXPR_ARG (call, i) = tmp_decl;
+        }
+      i++;
+    }
+
+  return call;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/conv1.c	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,213 @@
+#include <stdio.h>
+#include <stdlib.h>
+static int loop;
+#if 1 // def __micro_c__
+#define CC_ONLY 0
+#else
+#define CC_ONLY 1
+#endif
+typedef char *stack;
+#include "conv1.h"
+
+/* classical function call case (0) */
+f0(int i) {
+    int k,j;
+    k = 3+i;
+    j = g0(i+3);
+    return k+4+j;
+}
+
+g0(int i) {
+    return h0(i+4)+i;
+}
+h0(int i) {
+    return i+4;
+}
+
+#if !CC_ONLY
+/* straight conversion case (1) */
+struct cont_interface { // General Return Continuation
+    __code (*ret)();
+};
+
+__code f(int i,stack sp) {
+    int k,j;
+    k = 3+i;
+    goto f_g0(i,k,sp);
+}
+
+struct f_g0_interface {  // Specialized Return Continuation
+    __code (*ret)();
+    int i_,k_,j_;
+};
+
+__code f_g1(int j,stack sp);
+
+__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));
+
+    c->ret = f_g1;
+    c->k_ = k;
+    c->i_ = i;
+
+    goto g(i+3,sp);
+}
+
+__code f_g1(int j,stack sp) {  // Continuation 
+    struct f_g0_interface *c = (struct f_g0_interface *)sp;
+    int k = c->k_;
+    sp+=sizeof(struct f_g0_interface);
+    c = (struct f_g0_interface *)sp;
+    goto (c->ret)(k+4+j,sp);
+}
+
+__code g_h1(int j,stack sp);
+__code g(int i,stack sp) { // Caller
+    struct f_g0_interface *c = 
+	(struct f_g0_interface *)(sp -= sizeof(struct f_g0_interface));
+
+    c->ret = g_h1;
+    c->i_ = i;
+
+    goto h(i+3,sp);
+}
+
+__code g_h1(int j,stack sp) {  // Continuation 
+    struct f_g0_interface *c = (struct f_g0_interface *)sp;
+    int i = c->i_;
+    sp+=sizeof(struct f_g0_interface);
+    c = (struct f_g0_interface *)sp;
+    goto (c->ret)(j+i,sp);
+}
+
+__code h(int i,stack sp) {
+    struct f_g0_interface *c = (struct f_g0_interface *)sp;
+    goto (c->ret)(i+4,sp);
+}
+
+struct main_continuation { // General Return Continuation
+    __code (*ret)();
+    __code (*main_ret)(int,void*);
+    void *env;
+};
+
+__code main_return(int i,stack sp) {
+    if (loop-->0)
+	goto f(233,sp);
+    printf("#0103:%d\n",i);
+    goto (( (struct main_continuation *)sp)->main_ret)(0,
+       ((struct main_continuation *)sp)->env);
+}
+
+/* little optimzation without stack continuation (2) */
+__code f2(int i,char *sp) {
+    int k,j;
+    k = 3+i;
+    goto g2(i,k,i+3,sp);
+}
+
+__code g2(int i,int k,int j,char *sp) {
+    j = j+4;
+    goto h2(i,k+4+j,sp);
+}
+
+__code h2_1(int i,int k,int j,char *sp) {
+    goto main_return2(i+j,sp);
+}
+
+__code h2(int i,int k,char *sp) {
+    goto h2_1(i,k,i+4,sp);
+}
+
+__code main_return2(int i,stack sp) {
+    if (loop-->0)
+	goto f2(233,sp);
+    printf("#0132:%d\n",i);
+    goto (( (struct main_continuation *)sp)->main_ret)(0,
+          ((struct main_continuation *)sp)->env);
+}
+
+/* little optimizaed case (3) */
+__code f2_1(int i,char *sp) {
+    int k,j;
+    k = 3+i;
+    goto g2_1(k,i+3,sp);
+}
+
+__code g2_1(int k,int i,char *sp) {
+    goto h2_11(k,i+4,sp);
+}
+
+__code f2_0_1(int k,int j,char *sp);
+__code h2_1_1(int i,int k,int j,char *sp) {
+    goto f2_0_1(k,i+j,sp);
+}
+
+__code h2_11(int i,int k,char *sp) {
+    goto h2_1_1(i,k,i+4,sp);
+}
+
+__code f2_0_1(int k,int j,char *sp) {
+    goto (( (struct cont_interface *)sp)->ret)(k+4+j,sp);
+}
+
+__code main_return2_1(int i,stack sp) {
+    if (loop-->0)
+        goto f2_1(233,sp);
+    printf("#0165:%d\n",i);
+    goto (( (struct main_continuation *)sp)->main_ret)(0,
+	    ((struct main_continuation *)sp)->env);
+}
+
+#define STACK_SIZE 2048
+char main_stack[STACK_SIZE];
+#define stack_last (main_stack+STACK_SIZE)
+#endif
+#define LOOP_COUNT 500000000
+int
+main(int ac,char *av[])
+{
+#if !CC_ONLY
+    struct main_continuation *cont;
+    stack sp = stack_last;
+#endif
+    int sw;
+    int j;
+    if (ac==2) sw = atoi(av[1]);
+    else sw=3;
+
+    if (sw==0) {
+	for(loop=0;loop<LOOP_COUNT;loop++) {
+	   j = f0(233);
+	}
+	printf("#0193:%d\n",j);
+#if !CC_ONLY
+    } else if (sw==1) {
+	loop = LOOP_COUNT;
+	sp -= sizeof(*cont);
+	cont = (struct main_continuation *)sp;
+	cont->ret = main_return;
+	cont->main_ret = _CbC_return;
+	cont->env = _CbC_environment;
+	goto f(233,sp);
+    } else if (sw==2) {
+	loop = LOOP_COUNT;
+	sp -= sizeof(*cont);
+	cont = (struct main_continuation *)sp;
+	cont->ret = main_return2;
+	cont->main_ret = _CbC_return;
+	cont->env = _CbC_environment;
+	goto f2(233,sp);
+    } else if (sw==3) {
+	loop = LOOP_COUNT;
+	sp -= sizeof(*cont);
+	cont = (struct main_continuation *)sp;
+	cont->ret = main_return2_1;
+	cont->main_ret = _CbC_return;
+	cont->env = _CbC_environment;
+	goto f2_1(233,sp);
+#endif
+    }
+return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/conv1.c~	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,227 @@
+#include <stdio.h>
+#include <stdlib.h>
+static int loop;
+
+#if 1 // def __micro_c__
+#define CC_ONLY 0
+#else
+#define CC_ONLY 1
+#endif
+
+typedef char *stack;
+#include "conv1.h"
+
+/* classical function call case (0) */
+
+f0(int i) {
+    int k,j;
+    k = 3+i;
+    j = g0(i+3);
+    return k+4+j;
+}
+
+g0(int i) {
+    return h0(i+4)+i;
+}
+
+h0(int i) {
+    return i+4;
+}
+
+#if !CC_ONLY
+
+/* straight conversion case (1) */
+
+
+struct cont_interface { // General Return Continuation
+    __code (*ret)();
+};
+
+__code f(int i,stack sp) {
+    int k,j;
+    k = 3+i;
+    goto f_g0(i,k,sp);
+}
+
+struct f_g0_interface {  // Specialized Return Continuation
+    __code (*ret)();
+    int i_,k_,j_;
+};
+
+__code f_g1(int j,stack sp);
+
+__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));
+
+    c->ret = f_g1;
+    c->k_ = k;
+    c->i_ = i;
+
+    goto g(i+3,sp);
+}
+
+__code f_g1(int j,stack sp) {  // Continuation 
+    struct f_g0_interface *c = (struct f_g0_interface *)sp;
+    int k = c->k_;
+    sp+=sizeof(struct f_g0_interface);
+    c = (struct f_g0_interface *)sp;
+    goto (c->ret)(k+4+j,sp);
+}
+
+__code g_h1(int j,stack sp);
+
+__code g(int i,stack sp) { // Caller
+    struct f_g0_interface *c = 
+	(struct f_g0_interface *)(sp -= sizeof(struct f_g0_interface));
+
+    c->ret = g_h1;
+    c->i_ = i;
+
+    goto h(i+3,sp);
+}
+
+__code g_h1(int j,stack sp) {  // Continuation 
+    struct f_g0_interface *c = (struct f_g0_interface *)sp;
+    int i = c->i_;
+    sp+=sizeof(struct f_g0_interface);
+    c = (struct f_g0_interface *)sp;
+    goto (c->ret)(j+i,sp);
+}
+
+__code h(int i,stack sp) {
+    struct f_g0_interface *c = (struct f_g0_interface *)sp;
+    goto (c->ret)(i+4,sp);
+}
+
+struct main_continuation { // General Return Continuation
+    __code (*ret)();
+    __code (*main_ret)(int,void*);
+    void *env;
+};
+
+__code main_return(int i,stack sp) {
+    if (loop-->0)
+	goto f(233,sp);
+    printf("#0103:%d\n",i);
+    goto (( (struct main_continuation *)sp)->main_ret)(0,
+       ((struct main_continuation *)sp)->env);
+}
+
+/* little optimzation without stack continuation (2) */
+
+__code f2(int i,char *sp) {
+    int k,j;
+    k = 3+i;
+    goto g2(i,k,i+3,sp);
+}
+
+__code g2(int i,int k,int j,char *sp) {
+    j = j+4;
+    goto h2(i,k+4+j,sp);
+}
+
+__code h2_1(int i,int k,int j,char *sp) {
+    goto main_return2(i+j,sp);
+}
+
+__code h2(int i,int k,char *sp) {
+    goto h2_1(i,k,i+4,sp);
+}
+
+__code main_return2(int i,stack sp) {
+    if (loop-->0)
+	goto f2(233,sp);
+    printf("#0132:%d\n",i);
+    goto (( (struct main_continuation *)sp)->main_ret)(0,
+          ((struct main_continuation *)sp)->env);
+}
+
+/* little optimizaed case (3) */
+
+__code f2_1(int i,char *sp) {
+    int k,j;
+    k = 3+i;
+    goto g2_1(k,i+3,sp);
+}
+
+__code g2_1(int k,int i,char *sp) {
+    goto h2_11(k,i+4,sp);
+}
+
+__code f2_0_1(int k,int j,char *sp);
+__code h2_1_1(int i,int k,int j,char *sp) {
+    goto f2_0_1(k,i+j,sp);
+}
+
+__code h2_11(int i,int k,char *sp) {
+    goto h2_1_1(i,k,i+4,sp);
+}
+
+__code f2_0_1(int k,int j,char *sp) {
+    goto (( (struct cont_interface *)sp)->ret)(k+4+j,sp);
+}
+
+__code main_return2_1(int i,stack sp) {
+    if (loop-->0)
+        goto f2_1(233,sp);
+    printf("#0165:%d\n",i);
+    goto (( (struct main_continuation *)sp)->main_ret)(0,
+	    ((struct main_continuation *)sp)->env);
+}
+
+#define STACK_SIZE 2048
+char main_stack[STACK_SIZE];
+#define stack_last (main_stack+STACK_SIZE)
+
+#endif
+
+#define LOOP_COUNT 500000000
+int
+main(int ac,char *av[])
+{
+#if !CC_ONLY
+    struct main_continuation *cont;
+    stack sp = stack_last;
+#endif
+    int sw;
+    int j;
+    if (ac==2) sw = atoi(av[1]);
+    else sw=3;
+
+    if (sw==0) {
+	for(loop=0;loop<LOOP_COUNT;loop++) {
+	   j = f0(233);
+	}
+	printf("#0193:%d\n",j);
+#if !CC_ONLY
+    } else if (sw==1) {
+	loop = LOOP_COUNT;
+	sp -= sizeof(*cont);
+	cont = (struct main_continuation *)sp;
+	cont->ret = main_return;
+	cont->main_ret = _CbC_return;
+	cont->env = _CbC_environment;
+	goto f(233,sp);
+    } else if (sw==2) {
+	loop = LOOP_COUNT;
+	sp -= sizeof(*cont);
+	cont = (struct main_continuation *)sp;
+	cont->ret = main_return2;
+	cont->main_ret = _CbC_return;
+	cont->env = _CbC_environment;
+	goto f2(233,sp);
+    } else if (sw==3) {
+	loop = LOOP_COUNT;
+	sp -= sizeof(*cont);
+	cont = (struct main_continuation *)sp;
+	cont->ret = main_return2_1;
+	cont->main_ret = _CbC_return;
+	cont->env = _CbC_environment;
+	goto f2_1(233,sp);
+#endif
+    }
+return 0;
+}
+
+/* end */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/factorial.cbc~	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,17 @@
+__code print_factorial(int prod)
+{
+  printf("factorial = %d\n",prod);
+  exit(0);
+}
+__code factorial0(int prod, int x)
+{
+  if ( x >= 1) {
+    goto factorial0(prod*x, x-1);
+  }else{
+    goto print_factorial(prod);
+  }
+}
+__code factorial(int x)
+{
+  goto factorial0(1, x);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/regi-id.c	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,24 @@
+ case RID_CbC_CODE:
+if (specs->long_p)
+  error_at (loc,(
+                           "both %<long%> and %<void%> in "
+                           "declaration specifiers"));
+ else if (specs->short_p)
+   error_at (loc,
+	     ("both %<short%> and %<void%> in "
+	      "declaration specifiers"));
+ else if (specs->signed_p)
+   error_at (loc,
+	     ("both %<signed%> and %<void%> in "
+	      "declaration specifiers"));
+ else if (specs->unsigned_p)
+   error_at (loc,
+	     ("both %<unsigned%> and %<void%> in "
+	      "declaration specifiers"));
+ else if (specs->complex_p)
+   error_at (loc,
+	     ("both %<complex%> and %<void%> in "
+	      "declaration specifiers"));
+ else
+   specs->typespec_word = cts_CbC_code;
+return specs;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/regi-node.c	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,5 @@
+ case cts_CbC_code:
+   gcc_assert (!specs->long_p && !specs->short_p
+	       && !specs->signed_p && !specs->unsigned_p
+	       && !specs->complex_p);
+   specs->type = void_type_node;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/regi-node.c~	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,6 @@
+ case cts_CbC_code:
+#endif
+gcc_assert (!specs->long_p && !specs->short_p
+                  && !specs->signed_p && !specs->unsigned_p
+	    && !specs->complex_p);
+specs->type = void_type_node;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/reswords.c	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,8 @@
+const struct c_common_resword c_common_reswords[] =
+  {
+    { "_Bool",            RID_BOOL,      D_CONLY },
+    { "_Complex",         RID_COMPLEX,    0 },
+    :
+    /* CbC project */
+    { "__code",         RID_CbC_CODE,   0 },
+    :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/reswords.c~	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,8 @@
+const struct c_common_resword c_common_reswords[] =
+  {
+    { "_Bool",            RID_BOOL,      D_CONLY },
+    { "_Complex",         RID_COMPLEX,    0 },
+    :
+    /* CbC project */
+    { "__code",         RID_CbC_CODE,   0 },
+    :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/return.c	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,10 @@
+__code factorial0(int prod, int x)
+{
+  if ( x >= 1) {
+    goto factorial0(prod*x, x-1);
+    return;
+  }else{
+    goto print_factorial(prod);
+    return;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/rid-goto.c	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,51 @@
+case RID_GOTO:
+ c_parser_consume_token (parser);
+#ifndef noCbC
+ if ( c_parser_next_token_is (parser, CPP_NAME)
+      && c_parser_peek_2nd_token (parser)->type == CPP_SEMICOLON )
+   {
+#else
+    if (c_parser_next_token_is (parser, CPP_NAME))
+      {
+#endif
+	stmt = c_finish_goto_label (loc,
+				    c_parser_peek_token (parser)->value);
+	c_parser_consume_token (parser);
+      }
+    else if (c_parser_next_token_is (parser, CPP_MULT))
+      {
+	tree val;
+
+	c_parser_consume_token (parser);
+	val = c_parser_expression (parser).value;
+	mark_exp_read (val);
+	stmt = c_finish_goto_ptr (loc, val);
+      }
+    else
+#ifndef noCbC
+      {
+	if (c_parser_next_token_is (parser, CPP_NAME))
+          {
+	    tree id = c_parser_peek_token (parser)->value;
+	    location_t loc = c_parser_peek_token (parser)->location;
+	    /** build_external_ref (id,RID_CbC_CODE , loc); **/
+	    build_external_ref (loc, id, RID_CbC_CODE, &expr.original_type);
+          }
+	expr = c_parser_expr_no_commas (parser, NULL);
+	if (TREE_CODE(expr.value) == CALL_EXPR )
+          {
+	    location_t loc = c_parser_peek_token (parser)->location;
+	    cbc_replace_arguments (loc, expr.value);
+
+	    TREE_TYPE(expr.value) = void_type_node;
+	    /*tree env = NULL_TREE;**/
+	    CbC_IS_CbC_GOTO (expr.value) = 1;
+	    CALL_EXPR_TAILCALL (expr.value) = 1;
+	    add_stmt(expr.value);
+	    stmt = c_finish_return(loc, NULL_TREE, NULL_TREE); /* stmt = c_finish_return (0); */
+          }
+	else
+	  c_parser_error (parser, "expected code segment jump or %<*%>");
+      }
+#else
+    c_parser_error (parser, "expected identifier or %<*%>");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/rid-goto.c~	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,53 @@
+ case RID_GOTO:
+c_parser_consume_token (parser);
+#ifndef noCbC
+if ( c_parser_next_token_is (parser, CPP_NAME)
+     && c_parser_peek_2nd_token (parser)->type == CPP_SEMICOLON )
+  {
+#else
+    if (c_parser_next_token_is (parser, CPP_NAME))
+      {
+#endif
+	stmt = c_finish_goto_label (loc,
+				    c_parser_peek_token (parser)->value);
+	c_parser_consume_token (parser);
+      }
+    else if (c_parser_next_token_is (parser, CPP_MULT))
+      {
+	tree val;
+
+	c_parser_consume_token (parser);
+	val = c_parser_expression (parser).value;
+	mark_exp_read (val);
+	stmt = c_finish_goto_ptr (loc, val);
+      }
+    else
+#ifndef noCbC
+      {
+	if (c_parser_next_token_is (parser, CPP_NAME))
+          {
+	    tree id = c_parser_peek_token (parser)->value;
+	    location_t loc = c_parser_peek_token (parser)->location;
+	    /** build_external_ref (id,RID_CbC_CODE , loc); **/
+	    build_external_ref (loc, id, RID_CbC_CODE, &expr.original_type);
+          }
+	expr = c_parser_expr_no_commas (parser, NULL);
+	if (TREE_CODE(expr.value) == CALL_EXPR )
+          {
+	    location_t loc = c_parser_peek_token (parser)->location;
+	    cbc_replace_arguments (loc, expr.value);
+
+	    TREE_TYPE(expr.value) = void_type_node;
+	    /*tree env = NULL_TREE;**/
+	    CbC_IS_CbC_GOTO (expr.value) = 1;
+	    CALL_EXPR_TAILCALL (expr.value) = 1;
+	    add_stmt(expr.value);
+	    stmt = c_finish_return(loc, NULL_TREE, NULL_TREE); /* stmt = c_finish_return (0); */
+          }
+	else
+	  c_parser_error (parser, "expected code segment jump or %<*%>");
+      }
+#else
+    c_parser_error (parser, "expected identifier or %<*%>");
+#endif
+    goto expect_semicolon;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/rid_goto.c	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,19 @@
+if (c_parser_next_token_is (parser, CPP_NAME))
+  {
+    tree id = c_parser_peek_token (parser)->value;
+    location_t loc = c_parser_peek_token (parser)->location;
+
+    build_external_ref (loc, id, RID_CbC_CODE, &expr.original_type);
+  }
+expr = c_parser_expr_no_commas (parser, NULL);
+if (TREE_CODE(expr.value) == CALL_EXPR )
+  {
+    location_t loc = c_parser_peek_token (parser)->location;
+    cbc_replace_arguments (loc, expr.value);
+
+    TREE_TYPE(expr.value) = void_type_node;
+    CbC_IS_CbC_GOTO (expr.value) = 1;
+    CALL_EXPR_TAILCALL (expr.value) = 1;
+    add_stmt(expr.value);
+    stmt = c_finish_return(loc, NULL_TREE, NULL_TREE);
+  }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/rid_goto.c~	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,19 @@
+if (c_parser_next_token_is (parser, CPP_NAME))
+  {
+    tree id = c_parser_peek_token (parser)->value;
+    location_t loc = c_parser_peek_token (parser)->location;
+    /** build_external_ref (id,RID_CbC_CODE , loc); **/
+    build_external_ref (loc, id, RID_CbC_CODE, &expr.original_type);
+  }
+expr = c_parser_expr_no_commas (parser, NULL);
+if (TREE_CODE(expr.value) == CALL_EXPR )
+  {
+    location_t loc = c_parser_peek_token (parser)->location;
+    cbc_replace_arguments (loc, expr.value);
+
+    =>            TREE_TYPE(expr.value) = void_type_node;
+    /*tree env = NULL_TREE;**/
+    CbC_IS_CbC_GOTO (expr.value) = 1;
+    CALL_EXPR_TAILCALL (expr.value) = 1;
+    add_stmt(expr.value);
+    stmt = c_finish_return(loc, NULL_TREE, NULL_TREE); /* stmt = c_finish_return (0); */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/tail_call_flag.c	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,5 @@
+if (currently_expanding_call++ != 0
+    || ((!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl))) && !flag_optimize_sibling_calls)
+    || args_size.var
+    || dbg_cnt (tail_call) == false)
+  try_tail_call = 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/source/tail_call_flag.c~	Wed Nov 23 02:27:44 2011 +0900
@@ -0,0 +1,5 @@
+if (currently_expanding_call++ != 0
+    || ((!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl))) && !flag_optimize_sibling_calls)
+      || args_size.var
+    || dbg_cnt (tail_call) == false)
+  try_tail_call = 0;