This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Reachable code discarded


GCC can discard reachable code in certain cases. 

Consider the following x.c.09.cse. The ``(label_ref:SI 16)'' in insn
#48 constitutes an edge in the cfg, however GCC does not create an
``edge'' for it. Later, the jump from insn #52:#54 to insn #16 is
redirected to insn #64 and the basic block starting at insn #16 is
deleted.

This is produced from 20010106-1.c by a modified v850/v850e backend. I
can send a raw diff if needed.

~velco

(note 2 0 3 NOTE_INSN_DELETED)

(note 3 2 76 NOTE_INSN_FUNCTION_BEG)

;; Start of basic block 0, registers live: (nil)
(note 76 3 10 0 [bb 0] NOTE_INSN_BASIC_BLOCK)

(insn 10 76 42 0 0x40163800 (set (reg/v:SI 40)
        (const_int 0 [0x0])) 4 {*movsi_internal} (nil)
    (expr_list:REG_EQUAL (const_int 0 [0x0])
        (nil)))

(insn 42 10 44 0 0x40163800 (set (reg:SI 44)
        (const_int 0 [0x0])) 4 {*movsi_internal} (nil)
    (expr_list:REG_EQUAL (const_int 0 [0x0])
        (nil)))

(insn 44 42 45 0 0x40163800 (set (reg:SI 44)
        (reg/v:SI 40)) 4 {*movsi_internal} (nil)
    (insn_list:REG_WAS_0 42 (expr_list:REG_EQUAL (const_int 0 [0x0])
            (nil))))

(insn 45 44 46 0 0x40163800 (set:SI (reg/f:SI 46)
        (high:SI (label_ref:SI 53))) 2 {*movsi_high} (nil)
    (expr_list:REG_EQUAL (high:SI (label_ref:SI 53))
        (insn_list:REG_LABEL 53 (nil))))

(insn 46 45 47 0 0x40163800 (set:SI (reg/f:SI 45)
        (lo_sum:SI (reg/f:SI 46)
            (label_ref:SI 53))) 3 {*movsi_lo} (nil)
    (expr_list:REG_EQUAL (label_ref:SI 53)
        (insn_list:REG_LABEL 53 (nil))))

(insn 47 46 48 0 0x40163800 (set (reg:SI 44)
        (reg/f:SI 45)) 4 {*movsi_internal} (nil)
    (insn_list:REG_WAS_0 44 (expr_list:REG_EQUAL (label_ref:SI 53)
            (nil))))

(insn 48 47 49 0 0x40163800 (set (reg:HI 47)
        (const:HI (truncate:HI (minus:SI (label_ref:SI 16)
                    (label_ref:SI 53))))) 1 {*movhi_internal} (nil)
    (insn_list:REG_LABEL 16 (insn_list:REG_LABEL 53 (expr_list:REG_EQUAL (const:HI (truncate:HI (minus:SI (label_ref:SI 16)
                            (label_ref:SI 53))))
                (nil)))))

(insn 49 48 50 0 0x40163800 (set (reg:SI 48)
        (ashift:SI (subreg:SI (reg:HI 47) 0)
            (const_int 16 [0x10]))) 52 {ashlsi3} (nil)
    (nil))

(insn 50 49 51 0 0x40163800 (set (reg:SI 44)
        (ashiftrt:SI (reg:SI 48)
            (const_int 16 [0x10]))) 54 {ashrsi3} (nil)
    (nil))

(insn 51 50 52 0 0x40163800 (set (reg:SI 44)
        (plus:SI (reg:SI 44)
            (reg/f:SI 45))) 8 {addsi3} (nil)
    (nil))

(jump_insn 52 51 53 0 0x40163800 (parallel [
            (set (pc)
                (reg:SI 44))
            (use (label_ref 53))
        ]) 36 {tablejump} (nil)
    (nil))
;; End of basic block 0, registers live:
 (nil)

;; Insn is not within a basic block
(code_label 53 52 54 10 "" [4 uses])

;; Insn is not within a basic block
(jump_insn 54 53 55 (nil) (addr_diff_vec:HI (label_ref:SI 53)
         [
            (label_ref:SI 16)
            (label_ref:SI 21)
            (label_ref:SI 26)
            (label_ref:SI 31)
        ]
        (const_int 0 [0x0])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(barrier 55 54 16)

;; Start of basic block 2, registers live: (nil)
(code_label 16 55 78 2 4 "" [2 uses])

(note 78 16 17 2 [bb 2] NOTE_INSN_BASIC_BLOCK)

(note 17 78 18 2 ("x.c") 7)

(insn 18 17 19 2 0x40163800 (set (reg/v:SI 41)
        (const_int 0 [0x0])) 4 {*movsi_internal} (nil)
    (expr_list:REG_EQUAL (const_int 0 [0x0])
        (nil)))

(jump_insn 19 18 20 2 0x40163800 (set (pc)
        (label_ref 57)) -1 (nil)
    (nil))
;; End of basic block 2, registers live:
 (nil)

(barrier 20 19 21)

;; Start of basic block 3, registers live: (nil)
(code_label 21 20 79 3 6 "" [1 uses])

(note 79 21 22 3 [bb 3] NOTE_INSN_BASIC_BLOCK)

(note 22 79 23 3 ("x.c") 9)

(insn 23 22 24 3 0x40163800 (set (reg/v:SI 41)
        (const_int 3 [0x3])) 4 {*movsi_internal} (nil)
    (expr_list:REG_EQUAL (const_int 3 [0x3])
        (nil)))

(jump_insn 24 23 25 3 0x40163800 (set (pc)
        (label_ref 57)) -1 (nil)
    (nil))
;; End of basic block 3, registers live:
 (nil)

(barrier 25 24 26)

;; Start of basic block 4, registers live: (nil)
(code_label 26 25 80 4 7 "" [1 uses])

(note 80 26 27 4 [bb 4] NOTE_INSN_BASIC_BLOCK)

(note 27 80 28 4 ("x.c") 11)

(insn 28 27 29 4 0x40163800 (set (reg/v:SI 41)
        (const_int 15 [0xf])) 4 {*movsi_internal} (nil)
    (expr_list:REG_EQUAL (const_int 15 [0xf])
        (nil)))

(jump_insn 29 28 30 4 0x40163800 (set (pc)
        (label_ref 57)) -1 (nil)
    (nil))
;; End of basic block 4, registers live:
 (nil)

(barrier 30 29 31)

;; Start of basic block 5, registers live: (nil)
(code_label 31 30 81 5 8 "" [1 uses])

(note 81 31 32 5 [bb 5] NOTE_INSN_BASIC_BLOCK)

(note 32 81 33 5 ("x.c") 13)

(insn 33 32 37 5 0x40163800 (set (reg/v:SI 41)
        (const_int 9 [0x9])) 4 {*movsi_internal} (nil)
    (expr_list:REG_EQUAL (const_int 9 [0x9])
        (nil)))
;; End of basic block 5, registers live:
 (nil)

(note 37 33 57 -3 ("x.c") 16)

;; Start of basic block 6, registers live: (nil)
(code_label 57 37 84 6 5 "" [3 uses])

(note 84 57 60 6 [bb 6] NOTE_INSN_BASIC_BLOCK)

(jump_insn 60 84 85 6 0x401637c0 (set (pc)
        (if_then_else (eq:SI (reg/v:SI 41)
                (const_int 0 [0x0]))
            (label_ref 64)
            (pc))) 32 {*branch_normal} (nil)
    (expr_list:REG_BR_PRED (concat (const_int 8 [0x8])
            (const_int 100 [0x64]))
        (expr_list:REG_BR_PRED (concat (const_int 8 [0x8])
                (const_int 9900 [0x26ac]))
            (nil))))
;; End of basic block 6, registers live:
 (nil)

;; Start of basic block 7, registers live: (nil)
(note 85 60 62 7 [bb 7] NOTE_INSN_BASIC_BLOCK)

(call_insn 62 85 63 7 0x401637c0 (parallel [
            (call (mem:QI (symbol_ref:SI ("abort")) [0 S1 A8])
                (const_int 16 [0x10]))
            (clobber (reg:SI 31 r31))
        ]) -1 (nil)
    (expr_list:REG_NORETURN (const_int 0 [0x0])
        (expr_list:REG_EH_REGION (const_int 0 [0x0])
            (nil)))
    (nil))
;; End of basic block 7, registers live:
 (nil)

(barrier 63 62 64)

;; Start of basic block 8, registers live: (nil)
(code_label 64 63 86 8 2 "" [1 uses])

(note 86 64 66 8 [bb 8] NOTE_INSN_BASIC_BLOCK)

(insn 66 86 67 8 0x401637c0 (set (reg:SI 6 r6)
        (const_int 0 [0x0])) 4 {*movsi_internal} (nil)
    (expr_list:REG_EQUAL (const_int 0 [0x0])
        (nil)))

(call_insn 67 66 68 8 0x401637c0 (parallel [
            (call (mem:QI (symbol_ref:SI ("exit")) [0 S1 A8])
                (const_int 16 [0x10]))
            (clobber (reg:SI 31 r31))
        ]) 37 {call_internal_short} (nil)
    (expr_list:REG_NORETURN (const_int 0 [0x0])
        (expr_list:REG_EH_REGION (const_int 0 [0x0])
            (nil)))
    (expr_list (use (reg:SI 6 r6))
        (nil)))
;; End of basic block 8, registers live:
 (nil)

(barrier 68 67 69)

(note 69 68 0 NOTE_INSN_FUNCTION_END)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]