https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103270

--- Comment #5 from luoxhu at gcc dot gnu.org ---
;; Loop 0
;;  header 0, latch 1
;;  depth 0, outer -1
;;  nodes: 0 1 2 3 4 5 6 11 7 8 10 9
;;
;; Loop 1
;;  header 8, latch 7
;;  depth 1, outer 0
;;  nodes: 8 7 6 10 5 4 11 3
;;
;; Loop 2
;;  header 6, latch 5
;;  depth 2, outer 1
;;  nodes: 6 5 4 11 3
;;
;; Loop 3
;;  header 4, latch 3
;;  depth 3, outer 2
;;  nodes: 4 3
;; 2 succs { 8 }
;; 3 succs { 4 }
;; 4 succs { 3 5 }
;; 5 succs { 6 }
;; 6 succs { 11 7 }
;; 11 succs { 4 }
;; 7 succs { 8 }
;; 8 succs { 10 9 }
;; 10 succs { 6 }
;; 9 succs { 1 }

The CFG is:

2
|
8<----
| \  |
10 9 |
|    |
6----7
6<----
|    | 
11   | 
|    |
4<-  | 
| \| |
5  3 |
|    |
------

When iterating loop 3 in predict_extra_loop_exits, exit edge is 4->5, it finds
edge 3->4 for statement "if (d_8 == 0)", and set all e->src->preds with
"predict_paths_leading_to_edge (e1, PRED_LOOP_EXTRA_EXIT, NOT_TAKEN);".

(gdb) pbb 3
;; basic block 3, loop depth 3
;;  pred:       4
_1 = *i_19(D);
_2 = a_4 & c_6;
_3 = _1 + _2;
*i_19(D) = _3;
;;  succ:       4

(gdb) pbb 4
;; basic block 4, loop depth 3
;;  pred:       11
;;              3
# c_6 = PHI <c_7(11), b_5(3)>
# d_8 = PHI <0(11), 1(3)>
if (d_8 == 0)
  goto <bb 3>; [INV]
else
  goto <bb 5>; [INV]
;;  succ:       3
;;              5 
(gdb) p e->src->preds
$16 = 0x7ffff4fba140 = {<edge 0x7ffff4d05b20 (4 -> 3)>}

Reply via email to