[前][次][番号順一覧][スレッド一覧]

ruby-changes:22229

From: naruse <ko1@a...>
Date: Thu, 12 Jan 2012 14:12:14 +0900 (JST)
Subject: [ruby-changes:22229] naruse:r34278 (trunk): * cont.c (cont_restore_0): prevent optimizing out `sp'. sp is used for

naruse	2012-01-12 14:12:03 +0900 (Thu, 12 Jan 2012)

  New Revision: 34278

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34278

  Log:
    * cont.c (cont_restore_0): prevent optimizing out `sp'. sp is used for
      reserving a memory space with ALLOCA_N for restoring machine stack
      stored in cont->machine_stack, but clang optimized out it (and
      maybe #5851 is also caused by this).
      This affected TestContinuation#test_check_localvars.
    
    * cont.c (cont_restore_1): revert workaround introduced in r32201.

  Modified files:
    trunk/ChangeLog
    trunk/cont.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34277)
+++ ChangeLog	(revision 34278)
@@ -1,3 +1,13 @@
+Thu Jan 12 13:51:00 2012  NARUSE, Yui  <naruse@r...>
+
+	* cont.c (cont_restore_0): prevent optimizing out `sp'. sp is used for
+	  reserving a memory space with ALLOCA_N for restoring machine stack
+	  stored in cont->machine_stack, but clang optimized out it (and
+	  maybe #5851 is also caused by this).
+	  This affected TestContinuation#test_check_localvars.
+
+	* cont.c (cont_restore_1): revert workaround introduced in r32201.
+
 Thu Jan 12 02:14:43 2012  Ayumu AIZAWA  <ayumu.aizawa@g...>
 
 	* object.c: Added examples for Object#is_a? and
Index: cont.c
===================================================================
--- cont.c	(revision 34277)
+++ cont.c	(revision 34278)
@@ -676,10 +676,9 @@
     }
 #endif
     if (cont->machine_stack_src) {
-	size_t i;
 	FLUSH_REGISTER_WINDOWS;
-	for (i = 0; i < cont->machine_stack_size; i++)
-	    cont->machine_stack_src[i] = cont->machine_stack[i];
+	MEMCPY(cont->machine_stack_src, cont->machine_stack,
+		VALUE, cont->machine_stack_size);
     }
 
 #ifdef __ia64
@@ -749,7 +748,7 @@
 	    if (&space[0] > end) {
 # ifdef HAVE_ALLOCA
 		volatile VALUE *sp = ALLOCA_N(VALUE, &space[0] - end);
-		(void)sp;
+		space[0] = *sp;
 # else
 		cont_restore_0(cont, &space[0]);
 # endif
@@ -765,7 +764,7 @@
 	    if (&space[STACK_PAD_SIZE] < end) {
 # ifdef HAVE_ALLOCA
 		volatile VALUE *sp = ALLOCA_N(VALUE, end - &space[STACK_PAD_SIZE]);
-		(void)sp;
+		space[0] = *sp;
 # else
 		cont_restore_0(cont, &space[STACK_PAD_SIZE-1]);
 # endif

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]