changeset 133:420680fc7707

do normal call in goto codesegment in normal function
author anatofuz
date Sat, 03 Nov 2018 19:49:09 +0900
parents d34655255c78
children 71d4882a9ac3
files CbC-examples/stack1.c gcc/calls.c
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/CbC-examples/stack1.c	Thu Oct 25 10:21:07 2018 +0900
+++ b/CbC-examples/stack1.c	Sat Nov 03 19:49:09 2018 +0900
@@ -2,7 +2,7 @@
     test for CbC converted __code from C
  */
 
-//#include <stdio.h>
+#include <stdio.h>
 #define NULL 0
 extern int printf(const char*, ...);
 
--- a/gcc/calls.c	Thu Oct 25 10:21:07 2018 +0900
+++ b/gcc/calls.c	Sat Nov 03 19:49:09 2018 +0900
@@ -3726,7 +3726,10 @@
           warning(0, "no warning: unnamed code segment has been called from a function.");
         }
         */
-      args_size.constant = CbC_PRETENDED_STACK_SIZE;
+      // treat goto codesegments in normall function call as a function call
+      // this behavale same as llvm
+      //args_size.constant = CbC_PRETENDED_STACK_SIZE;
+	try_tail_call = 0;
     }
   else if ( fndecl && CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)) )
     {