[PATCH GCC]Allow cfgcleanup to remove forwarder loop preheaders and latches
bin.cheng
bin.cheng@arm.com
Tue Feb 25 05:12:00 GMT 2014
Hi,
This patch is to fix regression reported in PR60280 by removing forward loop
headers/latches in cfg cleanup if possible. Several tests are broken by
this change since cfg cleanup is shared by all optimizers. Some tests has
already been fixed by recent patches, I went through and fixed the others.
One case needs to be clarified is "gcc.dg/tree-prof/update-loopch.c". When
GCC removing a basic block, it checks profile information by calling
check_bb_profile after redirecting incoming edges of the bb. This certainly
results in warnings about invalid profile information and causes the case to
fail. I will send a patch to skip checking profile information for a
removing basic block in stage 1 if it sounds reasonable. For now I just
twisted the case itself.
Bootstrap and tested on x86_64 and arm_a15.
Is it OK?
2014-02-25 Bin Cheng <bin.cheng@arm.com>
PR target/60280
* tree-cfgcleanup.c (tree_forwarder_block_p): Protect loop
preheaders and latches only if requested. Fix latch if it
is removed.
* tree-ssa-dom.c (tree_ssa_dominator_optimize): Set
LOOPS_HAVE_PREHEADERS.
gcc/testsuite/ChangeLog
2014-02-25 Bin Cheng <bin.cheng@arm.com>
PR target/60280
* gnat.dg/renaming5.adb: Change to two expected gotos.
* gcc.dg/tree-ssa/pr21559.c: Change back to three expected
jump threads.
* gcc.dg/tree-prof/update-loopch.c: Check two "Invalid sum"
messages for removed basic block.
* gcc.dg/tree-ssa/ivopt_1.c: Fix unreliable scanning string.
* gcc.dg/tree-ssa/ivopt_2.c: Ditto.
* gcc.dg/tree-ssa/ivopt_3.c: Ditto.
* gcc.dg/tree-ssa/ivopt_4.c: Ditto.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: remove-latch_preheader-20140224.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140225/78f4340e/attachment.txt>
More information about the Gcc-patches
mailing list