Skip to content

Commit 635a774

Browse files
committed
Fix bootstrap failure by disabling problematic optimizations
The eliminate_dead_instructions() and fold_constant_branches() functions were corrupting the instruction stream and causing bootstrap failures. These functions appear to have issues with linked list manipulation that cause memory corruption during stage2 compilation. Commenting them out for now restores bootstrap capability while keeping all other safe optimizations active.
1 parent ddc9529 commit 635a774

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/peephole.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,9 @@ void peephole(void)
960960
{
961961
for (func_t *func = FUNC_LIST.head; func; func = func->next) {
962962
/* Phase 1: Dead code elimination complementing SCCP results */
963-
eliminate_dead_instructions(func);
964-
fold_constant_branches(func);
963+
/* FIXME: These functions break bootstrap, commenting out for now */
964+
/* eliminate_dead_instructions(func); */
965+
/* fold_constant_branches(func); */
965966

966967
/* Phase 2: Local peephole optimizations on post-register-allocation IR
967968
*/

0 commit comments

Comments
 (0)