------- Comment #1 from tbm at cyrius dot com 2007-10-21 09:46 ------- The problem is that gcc-4.2 generates a bne instruction that references a label that doesn't exist. This happens with -O1 or higher. It doesn't happen with gcc 4.1 or current trunk.
If you compile the attached preprocessed source and look at the assembler code you'll see it. Search for L2043 when you compile with -O1, for L2120 with -O2. % gcc-4.2 -c -S -O1 erlang-beam_emu.i Looking at erlang-beam_emu.s, we get $L2042: sw $0,44($sp) sw $19,0($21) sw $20,4($21) lw $25,%got(save_reg.15912)($28) nop sw $23,%lo(save_reg.15912)($25) lw $22,60($21) nop lw $2,0($22) lw $3,%got($L2035)($28) nop addiu $3,$3,%lo($L2035) bne $2,$3,$L2043 nop addiu $2,$20,8 beq $2,$0,$L2049 move $17,$0 $L2637: -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33848