This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: create preheaders for RTL loop optimizer
- From: Dale Johannesen <dalej at apple dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Dale Johannesen <dalej at apple dot com>
- Date: Sun, 13 Nov 2005 13:24:30 -0800
- Subject: Patch: create preheaders for RTL loop optimizer
The loop.c optimizer rejects all loops with multiple entry points,
which includes
multiple predecessors of the header. So I thought it would be a good
idea to
force preheaders when creating loop notes. This exposed a bug in the
preheader creation, when things are like this:
Latch: fallthru to header
Header: Latch and additional multiple predecessors
The header is split, then the latch->header edge is redirected, which
means
creating a new block in this case, then mfb_update_loops is invoked on
the
new block:
Latch: fallthru
New block: jump to header.2
Preheader (old header): multiple predecessors
Header.2 (new header):
Then mfb_update_loops tries to use loop_father from header.2, but this
has
not been set, so you get a crash (shows up in bootstrap on Darwin).
Seems
simplest to copy this field in split_block. Regtested Darwin ppc, OK?
2005-11-13 Dale Johannesen <dalej@apple.com>
* cfghooks.c (split_block): Copy loop_father.
* cfgloopmanip.c (create_loops_notes): Create preheaders.
Attachment:
diffs21.txt
Description: Text document