constant switch test bug in x86Translate

Stephen Weeks MLton@sourcelight.com
Mon, 15 Jan 2001 15:55:20 -0800 (PST)


> > In attempting to find a nasty G1 bug, I turned off a bunch of passes in the CPS
> > simplifier.  This tickled a silly bug in x86Translate.  It fails on constant
> > switch tests.  For example, mlton died in a self compile with the error
> > 	mlton:toX86Blocks: Switch
> > on the following switch statement
> > 	Switch (3, [(0, L_4175), (1, L_4176), (2, L_4177), (3, L_4178)], None)
> > 
> > Is it hard to make the codegen handle this?
> 
> Nope.  Here are new x86-mlton.{sig,fun} and x86-translate.fun to handle
> it.  Note: it's very inefficient, essentially I move the constant into a
> temporary and do the switch just like before (i.e., don't try to do the
> optimization which chooses the right label during translation).

Getting closer.  Adding that in tickled the following bug.  Presumably it's a
very similar problem in another pass.

   x86 code gen starting
      outputC starting
      outputC finished in 1.730
      outputAssembly starting
	 copyPropagate raised
	 simplify raised
      outputAssembly raised in 38.900
   x86 code gen raised in 220.840
Compile SML raised in 720.640
mlton: Transfer.replace