This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix sibcall-[1234].c testcases


Hi,
this patch fix sibcall testcases so they don't fail when track is early inlined.
The problem here is that track has local variable stackpos that it saves to global
var (to verify that it does not change during recursion).
This really prevents tailcall optimization, since address of local variable is escaping
the function (and even change behaviour of program for aborting to
non-aborting ;))

Regtested x86_64-linux and will commit it shortly.

Honza

	* sibcall-1.c (track): Mark noinline.
	* sibcall-2.c (track): Mark noinline.
	* sibcall-3.c (track): Mark noinline.
	* sibcall-4.c (track): Mark noinline.
Index: sibcall-1.c
===================================================================
--- sibcall-1.c	(revision 147582)
+++ sibcall-1.c	(working copy)
@@ -37,7 +37,7 @@ recurser_void (int n)
 
 void *trackpoint;
 
-void
+void __attribute__ ((noinline))
 track (int n)
 {
   char stackpos[1];
Index: sibcall-2.c
===================================================================
--- sibcall-2.c	(revision 147582)
+++ sibcall-2.c	(working copy)
@@ -38,7 +38,7 @@ recurser_void (void)
 
 void *trackpoint;
 
-void
+void __attribute__ ((noinline))
 track ()
 {
   char stackpos[1];
Index: sibcall-3.c
===================================================================
--- sibcall-3.c	(revision 147582)
+++ sibcall-3.c	(working copy)
@@ -66,7 +66,7 @@ recurser_void2 (int n)
 
 void *trackpoint;
 
-void
+void __attribute__ ((noinline))
 track (int n)
 {
   char stackpos[1];
Index: sibcall-4.c
===================================================================
--- sibcall-4.c	(revision 147582)
+++ sibcall-4.c	(working copy)
@@ -67,7 +67,7 @@ recurser_void2 (void)
 
 void *trackpoint;
 
-void
+void __attribute__ ((noinline))
 track ()
 {
   char stackpos[1];


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]