This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Use fixup_fallthru_exit_predecessor only for
- From: amylaar at spamcop dot net (Joern Rennecke)
- To: schwab at suse dot de (Andreas Schwab)
- Cc: joern dot rennecke at superh dot com (Joern Rennecke), dje at watson dot ibm dot com (David Edelsohn), amylaar at spamcop dot net (Joern Rennecke), apinski at apple dot com, gcc-patches at gcc dot gnu dot org
- Date: Wed, 16 Jun 2004 01:18:04 +0100 (BST)
- Subject: Re: RFA: Use fixup_fallthru_exit_predecessor only for
> $ /tmp/cvs/gcc-test-200406141500/Build/gcc/xgcc -B/tmp/cvs/gcc-test-200406141500/Build/gcc/ /tmp/cvs/gcc-test-200406141500/gcc/testsuite/gcc.c-torture/execute/20030120-2.c -w -O1 -lm -o /tmp/cvs/gcc-test-200406141500/Build/gcc/testsuite/20030120-2.x1
> $ /tmp/cvs/gcc-test-200406141500/Build/gcc/testsuite/20030120-2.x1
try_simplify_condjump uses can_fallthru to determine if one block precedes another.
This doesn't work any more when the latter block is the exit block.
2004-06-16 J"orn Rennecke <joern.rennecke@superh.com>
* cfgcleanup.c (try_simplify_condjump): Update test to make
sure we have a conditional branch around am unconditional branch.
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.117
diff -p -r1.117 cfgcleanup.c
*** cfgcleanup.c 3 Jun 2004 12:07:38 -0000 1.117
--- cfgcleanup.c 15 Jun 2004 23:03:02 -0000
*************** try_simplify_condjump (basic_block cbran
*** 163,169 ****
unconditional branch. */
cbranch_dest_block = cbranch_jump_edge->dest;
! if (!can_fallthru (jump_block, cbranch_dest_block))
return false;
/* Invert the conditional branch. */
--- 163,170 ----
unconditional branch. */
cbranch_dest_block = cbranch_jump_edge->dest;
! if (cbranch_dest_block == EXIT_BLOCK_PTR
! || !can_fallthru (jump_block, cbranch_dest_block))
return false;
/* Invert the conditional branch. */