This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR middle-end/30564, ICE due to inliner folding the wrong basic blocks
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Andrew Pinski" <pinskia at gmail dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 20 Aug 2007 09:38:35 +0200
- Subject: Re: [PATCH] Fix PR middle-end/30564, ICE due to inliner folding the wrong basic blocks
- References: <de8d50360708191613s61b96231ufdacd8d2aa01fb34@mail.gmail.com>
On 8/20/07, Andrew Pinski <pinskia@gmail.com> wrote:
> Hi,
> The problem here is that fold_marked_statements gets a basic block
> number which is different from the current maxium basic block. This
> happens as we call compact_blocks/number_blocks before folding. These
> 2 function calls renumber the basic blocks so we get the incorrect
> starting basic block. There are two ways of fixing this. The first
> way is to call fold_marked_statements with basic block 0 but that
> could cause slow down in some cases. The second way is to reorder the
> calls (incuding the cgraph checking). This is what this patch does.
>
> OK? Bootstrapped and tested on i386-apple-darwin with no regressions.
This is ok.
Thanks,
Richard.
> Thanks,
> Andrew Pinski
>
> ChangeLog:
> * tree-inline.c (optimize_inline_calls): Move the cgraph checking
> code in front of the compacting of basic blocks.
> Move the folding of statements inbetween the cgraph checking
> and compacting of basic blocks.
>
> * gcc.c-torture/compile/pr30564-1.c: New test.
> * gcc.c-torture/compile/pr30564-2.c: New test.
>
>