From 5b7d40d9b48f7abd19949db6391466f37d59b0c2 Mon Sep 17 00:00:00 2001 From: sheeple Date: Mon, 10 Nov 2008 02:58:05 -0600 Subject: [PATCH] We need to end the basic block after the ##prologue in the dispatch branch so that the GC check can go after the prologue --- basis/compiler/cfg/builder/builder.factor | 1 + basis/compiler/tests/templates.factor | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/basis/compiler/cfg/builder/builder.factor b/basis/compiler/cfg/builder/builder.factor index 93daa601fe..17a5942af2 100755 --- a/basis/compiler/cfg/builder/builder.factor +++ b/basis/compiler/cfg/builder/builder.factor @@ -171,6 +171,7 @@ M: #if emit-node [ V{ } clone node-stack set ##prologue + begin-basic-block emit-nodes basic-block get [ ##epilogue diff --git a/basis/compiler/tests/templates.factor b/basis/compiler/tests/templates.factor index de87ad8c00..0a109a15eb 100644 --- a/basis/compiler/tests/templates.factor +++ b/basis/compiler/tests/templates.factor @@ -219,3 +219,14 @@ TUPLE: my-tuple ; : bad-value-bug ( a -- b ) [ 3 ] [ 3 ] if f ; [ { f f f } ] [ t bad-value-bug ] unit-test + +! PowerPC regression +TUPLE: id obj ; + +: (gc-check-bug) ( a b -- c ) + { [ id boa ] [ id boa ] } dispatch ; + +: gc-check-bug ( -- ) + 10000000 [ "hi" 0 (gc-check-bug) drop ] times ; + +[ ] [ gc-check-bug ] unit-test