constant switch test bug in x86Translate
Stephen Weeks
MLton@sourcelight.com
Tue, 16 Jan 2001 14:48:51 -0800 (PST)
> > I'm looking into it, but are you reasonable confident that the program at
> > this point is valid?
>
> No. But the C backend did generate a G1 that shows the same problem (not a seg
> fault) that I have been fighting with for a few days now.
I finally found and fixed this bug. It was in constant propagation and had been
around for years. The bug was that the length of vectors was not propagated
properly. So, for eaxmple, the following program prints out "0" instead of
"1000".
val v = Vector.tabulate (1000, fn i => ())
val r = ref 0
val _ = r := Vector.length v
val _ = print (concat [Int.toString (!r), "\n"])
This was causing problems with the self-compile because I am migrating from
lists to vectors for the CPS IL. Anyways, after fixing the bug, I attempted a
self compile, which produced G1, which got a segfault when processing the basis
library. I decided that I'm in a weird enough state that it's worth rerunning
the regressions, and indeed, many of them failed. The only two changes since I
ran the regressions are my bug fix (a couple of lines in constant propagation)
and the codegen changes you sent today, so I'm betting on the codegen. I put a
snapshot at http://www.star-lab.com/sweeks/src.tgz. I'm now backing out the
codegen to the one from last night and trying again. I'll report shortly.