Author: sebor
Date: Wed Nov  7 20:29:17 2007
New Revision: 593006

URL: http://svn.apache.org/viewvc?rev=593006&view=rev
Log:
2007-11-07  Martin Sebor  <[EMAIL PROTECTED]>

        STDCXX-654
        * 18.setjmp.cpp (run_test): Qualified a local variable with volatile
        to work around what looks like a gcc optimizer bug.
        * 18.csetjmp.cpp (run_test): Ditto.

Modified:
    incubator/stdcxx/trunk/tests/support/18.csetjmp.cpp
    incubator/stdcxx/trunk/tests/support/18.setjmp.cpp

Modified: incubator/stdcxx/trunk/tests/support/18.csetjmp.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/support/18.csetjmp.cpp?rev=593006&r1=593005&r2=593006&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/support/18.csetjmp.cpp (original)
+++ incubator/stdcxx/trunk/tests/support/18.csetjmp.cpp Wed Nov  7 20:29:17 2007
@@ -2,7 +2,7 @@
  *
  * 18.csetjmp.cpp - test exercising [support.runtime], header <csetjmp>
  *
- * $Id:$
+ * $Id$
  *
  ***************************************************************************
  *
@@ -68,7 +68,9 @@
 #endif   // setjmp
 
     // verify that setjmp works
-    int arg = 1;
+    // using volatile to work around a gcc optimizer bug:
+    //   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34024
+    volatile int arg = 1;
     int result;
 
     result = setjmp (env);

Modified: incubator/stdcxx/trunk/tests/support/18.setjmp.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/support/18.setjmp.cpp?rev=593006&r1=593005&r2=593006&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/support/18.setjmp.cpp (original)
+++ incubator/stdcxx/trunk/tests/support/18.setjmp.cpp Wed Nov  7 20:29:17 2007
@@ -2,7 +2,7 @@
  *
  * 18.setjmp.cpp - test exercising [support.runtime], header <setjmp.h>
  *
- * $Id:$
+ * $Id$
  *
  ***************************************************************************
  *
@@ -68,7 +68,11 @@
 #endif   // setjmp
 
     // verify that setjmp works
-    int arg = 1;
+
+    // using volatile to work around a gcc optimizer bug:
+    //   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34024
+    volatile int arg = 1;
+
     int result;
 
     result = setjmp (env);


Reply via email to