-native self compile problems
Stephen Weeks
MLton@sourcelight.com
Wed, 29 Nov 2000 11:03:26 -0800 (PST)
> That's a known bug, with a really simple fix. In x86-codegen.fun, the
> outputAssembly function doesn't call done () before it loops to a new
> assembly file. That leaves the file open and unflushed, which causes
> these strange errors when the assembler hits it. Here's the correct
> version of the function:
Thanks. My bad. I've added the new outputAssembly.
> Interestingly, the total time is back to being reasonable. I'm very
> confused about this. A self compile I ran over the weekend also finished
> in under 2 hours. Likewise for one I ran this morning. And I've tried a
> self-compile rolled back to the update I sent out last week (with the fix
> above), also taking 2 hours. There is a lengthy pause near the end of the
> 8th assembly file, but certainly nothing like what originally raised this
> issue.
I can't reproduce it either.
> Because this bug isn't all that reproducible, I'm wondering if it might be
> something else besides the native backend. Could the done () bug above
> also have caused that divergent compile? I guess it depends on what
> SML/NJ does with open temporary files, but that seems unlikely.
I don't think so, but who knows.
I just tried a new G0 -> G1 native compile and it failed with an assertion
failure (toX86Blocks: Move) in the native backend. I've made a lot of changes
to other parts of the compiler, but the only changes I've made to the native
backend were in x86-translate to add Word{8,32}_neg and the new outputAssembly.
A snapshot of the sources that produces the failure is available at
http://www.star-lab.com/sweeks/mlton.tgz. Here is the log.
cd /home/sweeks/mlton/src/mlton && make
make[1]: Entering directory `/home/sweeks/mlton/src/mlton'
Compiling mlton (takes a while)
time mlton -v -no-polyvariance -native true mlton.cm
MLton internal-version (built Wed Nov 29 10:20:20 2000 on eponym.epr.com)
created this file on Wed Nov 29 10:21:48 2000.
Do not edit this file.
Flag settings:
aux: false
chunk: chunk per function
contify strategy: Both
defines: [NODEBUG]
fixed heap: None
indentation: 3
includes: [mlton.h]
inline: NonRecursive {product = 320,small = 60}
input file: mlton.cm
instrument: false
instrument Sxml: false
keep Cps: false
match: left to right
messages: true
native: true
native-commented: 0
native-copy-prop: true
native-ieee-fp: false
native-move-hoist: true
native-optimize: 1
native-split: Some(100000)
polyvariance: None
print at fun entry: false
profile: false
show types: false
compile starting
parse and elaborate starting
parse and elaborate finished in 155.190
core-ml size is ~1 bytes
numPeeks = 14
average position in property list = 0.000
numPeeks = 2449224
average position in bucket = 0.221
dead starting
dead finished in 0.310
basis size is ~1 bytes
numPeeks = 72624
average position in property list = 0.000
numPeeks = 2449224
average position in bucket = 0.221
size = 187031
gcc -DNODEBUG -I/home/sweeks/mlton/include -O1 -w -fomit-frame-pointer -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -o /tmp/filesQH9wb /tmp/fileHMEuUa.c -L/home/sweeks/mlton/lib -lmlton -lm -lgmp
/tmp/filesQH9wb /tmp/fileizw9iF
infer starting
unification starting
unification finished in 17.140
finish infer starting
finish infer finished in 61.750
infer finished in 80.100
xml.unsimplified size is ~1 bytes
numPeeks = 1078494
average position in property list = 0.000
numPeeks = 2587871
average position in bucket = 0.271
typeCheck starting
typeCheck finished in 15.570
infer simplify starting
infer simplify finished in 39.710
xml size is ~1 bytes
numPeeks = 5347414
average position in property list = 0.466
numPeeks = 2750544
average position in bucket = 0.344
typeCheck starting
typeCheck finished in 10.370
size = 122012
num types in program = 20481
num types in table = 37038
hash table size is ~1 bytes
mono starting
mono finished in 85.470
mono.unsimplified size is ~1 bytes
numPeeks = 10338869
average position in property list = 0.241
numPeeks = 3591008
average position in bucket = 0.689
typeCheck starting
typeCheck finished in 13.100
mono simplify starting
mono simplify finished in 51.780
mono size is ~1 bytes
numPeeks = 15769369
average position in property list = 0.373
numPeeks = 3687248
average position in bucket = 0.714
typeCheck starting
typeCheck finished in 10.690
size = 190318
num types in program = 12901
num types in table = 67579
hash table size is ~1 bytes
implement exceptions starting
implement exceptions finished in 1.820
sxml.unsimplified size is ~1 bytes
numPeeks = 16634435
average position in property list = 0.354
numPeeks = 3763159
average position in bucket = 0.736
typeCheck starting
typeCheck finished in 11.240
implement exceptions simplify starting
implement exceptions simplify finished in 38.440
sxml size is ~1 bytes
numPeeks = 20695840
average position in property list = 0.398
numPeeks = 3839781
average position in bucket = 0.758
typeCheck starting
typeCheck finished in 9.900
polyvariance starting
polyvariance finished in 0.000
sxml.poly size is ~1 bytes
numPeeks = 21233114
average position in property list = 0.388
numPeeks = 3912396
average position in bucket = 0.778
size = 178171
num types in program = 12475
num types in table = 68038
hash table size is ~1 bytes
closure convert starting
flow analysis starting
flow analysis finished in 11.190
flow size is ~1 bytes
numPeeks = 22273296
average position in property list = 0.370
numPeeks = 3928911
average position in bucket = 0.779
free variables starting
free variables finished in 5.010
globalize starting
globalize finished in 1.550
convert starting
convert finished in 105.950
closure convert finished in 127.570
cps.unsimplified size is ~1 bytes
numPeeks = 28930911
average position in property list = 1.461
numPeeks = 4287638
average position in bucket = 0.822
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 6.830
checkScopes finished in 16.760
typeCheck finished in 37.980
closure convert simplify starting
simplify starting
num functions 12036
num local functions 138225
num primExps 156105
numPeeks = 32876944
average position in property list = 1.294
numPeeks = 4369787
average position in bucket = 0.829
remove-unused starting
remove-unused finished in 7.420
num functions 10390
num local functions 80244
num primExps 139118
numPeeks = 36012911
average position in property list = 1.184
numPeeks = 4370113
average position in bucket = 0.829
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 3.780
checkScopes finished in 8.630
typeCheck finished in 24.610
leaf-inline starting
inline starting
inline finished in 24.040
leaf-inline finished in 24.040
num functions 7837
num local functions 56574
num primExps 137907
numPeeks = 40133816
average position in property list = 1.071
numPeeks = 4445146
average position in bucket = 0.835
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.760
checkScopes finished in 6.700
typeCheck finished in 21.020
raise-to-jump starting
inferHandlers starting
inferHandlers finished in 2.690
raise-to-jump finished in 22.590
num functions 7837
num local functions 56187
num primExps 137880
numPeeks = 43586799
average position in property list = 0.994
numPeeks = 4533344
average position in bucket = 0.841
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.650
checkScopes finished in 6.490
typeCheck finished in 20.730
contify starting
contify finished in 18.040
num functions 4207
num local functions 56719
num primExps 136015
numPeeks = 46947173
average position in property list = 0.930
numPeeks = 4625147
average position in bucket = 0.850
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.800
checkScopes finished in 6.700
typeCheck finished in 20.570
constant propagation starting
inferHandlers starting
inferHandlers finished in 2.670
fixed point starting
fixed point finished in 22.640
constant propagation finished in 51.270
num functions 4207
num local functions 56001
num primExps 101065
numPeeks = 51436152
average position in property list = 0.865
numPeeks = 4849136
average position in bucket = 0.961
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.690
checkScopes finished in 6.340
typeCheck finished in 20.270
useless starting
analyze starting
analyze finished in 45.450
useless finished in 84.160
num functions 4207
num local functions 53494
num primExps 91512
numPeeks = 55937769
average position in property list = 0.815
numPeeks = 5060757
average position in bucket = 0.970
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.660
checkScopes finished in 6.010
typeCheck finished in 17.330
remove-unused starting
remove-unused finished in 3.550
num functions 3603
num local functions 48690
num primExps 84852
numPeeks = 59313184
average position in property list = 0.772
numPeeks = 5125304
average position in bucket = 0.973
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.340
checkScopes finished in 5.250
typeCheck finished in 15.720
simplify-types starting
fixed point starting
fixed point finished in 0.210
simplify-types finished in 21.370
num functions 3603
num local functions 40565
num primExps 81665
numPeeks = 62772903
average position in property list = 0.738
numPeeks = 5192087
average position in bucket = 0.976
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.000
checkScopes finished in 4.360
typeCheck finished in 13.740
poly-equal starting
poly-equal finished in 0.580
num functions 3615
num local functions 41209
num primExps 82178
numPeeks = 64220221
average position in property list = 0.723
numPeeks = 5240451
average position in bucket = 0.980
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.040
checkScopes finished in 4.360
typeCheck finished in 13.820
contify starting
contify finished in 11.690
num functions 3518
num local functions 41195
num primExps 82052
numPeeks = 66405224
average position in property list = 0.702
numPeeks = 5288506
average position in bucket = 0.983
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 1.940
checkScopes finished in 4.350
typeCheck finished in 13.940
inline starting
inline finished in 30.900
num functions 971
num local functions 63845
num primExps 133775
numPeeks = 69846093
average position in property list = 0.672
numPeeks = 5336440
average position in bucket = 0.986
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 3.390
checkScopes finished in 7.000
typeCheck finished in 25.210
remove-unused starting
remove-unused finished in 4.560
num functions 971
num local functions 61189
num primExps 132682
numPeeks = 74445772
average position in property list = 0.633
numPeeks = 5448296
average position in bucket = 0.995
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 3.220
checkScopes finished in 6.920
typeCheck finished in 23.230
raise-to-jump starting
inferHandlers starting
inferHandlers finished in 3.010
raise-to-jump finished in 22.710
num functions 971
num local functions 60924
num primExps 132513
numPeeks = 77930470
average position in property list = 0.609
numPeeks = 5558724
average position in bucket = 1.004
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 3.110
checkScopes finished in 6.880
typeCheck finished in 24.710
contify starting
contify finished in 18.170
num functions 970
num local functions 60922
num primExps 132511
numPeeks = 81157552
average position in property list = 0.588
numPeeks = 5669033
average position in bucket = 1.013
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 3.060
checkScopes finished in 6.780
typeCheck finished in 23.080
introduce-loops starting
introduce-loops finished in 0.070
num functions 970
num local functions 60946
num primExps 132511
numPeeks = 83306255
average position in property list = 0.574
numPeeks = 5779359
average position in bucket = 1.021
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 3.060
checkScopes finished in 6.750
typeCheck finished in 23.030
loop-invariant starting
loop-invariant finished in 18.950
num functions 970
num local functions 58393
num primExps 125636
numPeeks = 86620821
average position in property list = 0.556
numPeeks = 5889661
average position in bucket = 1.029
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 3.040
checkScopes finished in 6.520
typeCheck finished in 23.690
flatten starting
analyze starting
analyze finished in 1.750
flatten finished in 32.280
num functions 970
num local functions 58472
num primExps 83851
numPeeks = 90441731
average position in property list = 0.536
numPeeks = 5998964
average position in bucket = 1.036
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.930
checkScopes finished in 7.780
typeCheck finished in 21.330
redundant starting
redundant finished in 7.950
num functions 970
num local functions 58472
num primExps 83851
numPeeks = 92882308
average position in property list = 0.525
numPeeks = 6084403
average position in bucket = 1.043
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.810
checkScopes finished in 6.080
typeCheck finished in 19.350
remove-unused starting
remove-unused finished in 5.440
num functions 970
num local functions 58150
num primExps 82178
numPeeks = 96744315
average position in property list = 0.506
numPeeks = 6169856
average position in bucket = 1.049
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.870
checkScopes finished in 6.120
typeCheck finished in 21.030
simplify finished in 850.170
closure convert simplify finished in 850.170
cps size is ~1 bytes
numPeeks = 98468552
average position in property list = 0.498
numPeeks = 6253735
average position in bucket = 1.056
typeCheck starting
checkScopes starting
inferHandlers starting
inferHandlers finished in 2.870
checkScopes finished in 6.150
typeCheck finished in 19.400
backend starting
compute representations starting
compute representations finished in 0.160
inferHandlers starting
inferHandlers finished in 2.930
chunkify starting
chunkify finished in 0.190
allocate registers starting
allocate registers finished in 304.510
reg size is ~1 bytes
numPeeks = 184680644
average position in property list = 1.099
numPeeks = 6337614
average position in bucket = 1.062
backend finished in 333.780
size is ~1 bytes
numPeeks = 186359907
average position in property list = 1.103
numPeeks = 6353911
average position in bucket = 1.062
x86 code gen starting
outputC starting
outputC finished in 1.170
outputAssembly starting
translateChunk raised
outputAssembly raised in 5.670
x86 code gen raised in 130.760
compile raised in 2049.230
mlton: assertion failure: toX86Blocks: Move
make[1]: Leaving directory `/home/sweeks/mlton/src/mlton'
Command exited with non-zero status 1
2026.63user 23.26system 34:11.34elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (4201major+2177322minor)pagefaults 0swaps
make[1]: *** [mlton] Error 1
make: *** [/home/sweeks/mlton/src/mlton/mlton] Error 2