diff --git a/ghc/rts/RtsFlags.c b/ghc/rts/RtsFlags.c
index a59f733e785815f596e76ec3ae1be870a4b724ac..d30fa2e2240e10369b94e304c0a4564a6ac0a4ba 100644
--- a/ghc/rts/RtsFlags.c
+++ b/ghc/rts/RtsFlags.c
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.10 1999/02/18 12:21:07 simonm Exp $
+ * $Id: RtsFlags.c,v 1.11 1999/02/18 13:00:27 sewardj Exp $
  *
  * (c) The AQUA Project, Glasgow University, 1994-1997
  * (c) The GHC Team, 1998-1999
@@ -444,7 +444,18 @@ error = rtsTrue;
 #ifdef DEBUG
 	      case 'D':
   	        /* hack warning: interpret the flags as a binary number */
-		*(int*)(&RtsFlags.DebugFlags) = decode(rts_argv[arg]+2);
+		{ 
+                   I_ n = decode(rts_argv[arg]+2);
+                   if (n     &1) RtsFlags.DebugFlags.scheduler   = rtsTrue;
+                   if ((n>>1)&1) RtsFlags.DebugFlags.evaluator   = rtsTrue;
+                   if ((n>>2)&1) RtsFlags.DebugFlags.codegen     = rtsTrue;
+                   if ((n>>3)&1) RtsFlags.DebugFlags.weak        = rtsTrue;
+                   if ((n>>4)&1) RtsFlags.DebugFlags.gccafs      = rtsTrue;
+                   if ((n>>5)&1) RtsFlags.DebugFlags.gc          = rtsTrue;
+                   if ((n>>6)&1) RtsFlags.DebugFlags.block_alloc = rtsTrue;
+                   if ((n>>7)&1) RtsFlags.DebugFlags.sanity      = rtsTrue;
+                   if ((n>>8)&1) RtsFlags.DebugFlags.stable      = rtsTrue;
+                }
 		break;
 #endif
 
diff --git a/ghc/rts/RtsFlags.h b/ghc/rts/RtsFlags.h
index 12588dce6267357273fa4cb0a660deaa97dfcab9..562202b8ee6728ebf99161aaf1daed5c9824b61a 100644
--- a/ghc/rts/RtsFlags.h
+++ b/ghc/rts/RtsFlags.h
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: RtsFlags.h,v 1.9 1999/02/05 16:02:50 simonm Exp $
+ * $Id: RtsFlags.h,v 1.10 1999/02/18 13:00:28 sewardj Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -39,7 +39,9 @@ struct GC_FLAGS {
 };
 
 /* Hack: this struct uses bitfields so that we can use a binary arg
- * with the -D flag
+ * with the -D flag.
+ * Remember to update the corresponding bit of RtsFlags.c if you
+ * change/extend this struct.
  */
 struct DEBUG_FLAGS {  
   /* flags to control debugging output in various subsystems */