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]

[PATCH] Fix PR middle-end/30564, ICE due to inliner folding the wrong basic blocks


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.

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.

Attachment: fixpr30564.diff.txt
Description: Text document


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