This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/18815] New: Tree if-conversion screws up cfg very badly
- From: "dberlin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Dec 2004 19:40:54 -0000
- Subject: [Bug tree-optimization/18815] New: Tree if-conversion screws up cfg very badly
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
On gcc.dg/pr17635.c, tree-if-conversion badly screws up the cfg (we just don't
notice because we aren't doing enough verification)
Before if-convresion:
(gdb) p debug_tree_bb (basic_block_info[0].data.bb[2])
;; basic block 2, loop depth 1, count 0
;; prev block 1, next block 3
;; pred: 1 [100.0%] (fallthru,dfs_back,exec) 0 [100.0%] (fallthru,exec)
;; succ: 3 [50.0%] (true,exec) 4 [50.0%] (false,exec)
# i_1 = PHI <i_4(1), i_2(0)>;
<L5>:;
if (i_1 != 0) goto <L1>; else goto <L6>;
After:
;; basic block 2, loop depth 1, count 0
;; prev block 0, next block -2
;; pred: 0 [100.0%] (fallthru,exec)
;; succ:
Invalid sum of incoming frequencies 1, should be 10000
# i_1 = PHI <i_2(0)>;
<L5>:;
_ifc_.0_5 = i_1 != 0;
i_3 = i_1 + 1;
i_4 = i_1 != 0 ? i_3 : i_1;
Note that our successors have completely disappeared (in fact, we now have no
path to the exit block at all).
It's fine to remove the successor blocks, but you still have to fix up the
successors on the new if-converted block so that they are going to the right place.
Simply compile pr17635.c with -ftree-vectorize, and look at the dumps, and you
can see this.
On diego's pending tree-cleanup-branch merge, more checking was added, and this
is triggering errors in it.
--
Summary: Tree if-conversion screws up cfg very badly
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dberlin at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: *-*-*
GCC host triplet: *-*-*
GCC target triplet: *-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18815