This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix hoisting -fcompare-debug failures (PR debug/45105)


On 07/28/10 09:45, Jakub Jelinek wrote:
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.
OK.
Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]