Hi!
If a bb ends with a DEBUG_INSN, bb_size between -g and -g0
compilation might differ.
The problem is that hoist_code forgets to count BB_END (bb)
instruction (and doesn't even set to_bb_head for it, so it is left at 0).
If in -g0 the block ends with a real insn and with -g with
DEBUG_INSN, in the latter case the last real insn will be counted.
As discussed with Maxim on IRC, we should count even the last insn.
Fixed by using FOR_BB_INSNS macro, bootstrapped/regtested on x86_64-linux
and i686-linux. Ok for trunk?
2010-07-28 Jakub Jelinek<jakub@redhat.com>
PR debug/45105
* gcse.c (hoist_code): Use FOR_BB_INSNS macro.
* gcc.dg/pr45105.c: New test.