This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix hoisting -fcompare-debug failures (PR debug/45105)
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Maxim Kuvyrkov <maxim at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 28 Jul 2010 10:39:39 -0600
- Subject: Re: [PATCH] Fix hoisting -fcompare-debug failures (PR debug/45105)
- References: <20100728154547.GZ18378@tyan-ft48-01.lab.bos.redhat.com>
On 07/28/10 09:45, Jakub Jelinek wrote:
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<firstname.lastname@example.org>
* gcse.c (hoist_code): Use FOR_BB_INSNS macro.
* gcc.dg/pr45105.c: New test.