This is the mail archive of the gcc-patches@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]

Re: Non-call exceptions versus cse


Michael Matz writes:
 > Hi,
 > 
 > On Wed, 20 Nov 2002, Andrew Haley wrote:
 > 
 > >     output1 = ({ type t1; t1 = may_trap (i1); t1; });
 > >
 > > However, cse removes t1,
 > 
 > Hmm, this seems indeed wrong.
 > 
 > > which is how this disussion started.  There's
 > > a hole in my bucket...
 > 
 > > Well, they aren't so prevented.  The two patches I submitted are cases
 > > where the compiler does this combination.
 > >
 > > BTW, this is the RTL in question before CSE:
 > 
 > bb0:
 >   p63 <= 0
 >   p65 <= [p63 + 4] ; can_trap to bb ??
 > bb1:
 >   p61 <= p65
 > 
 > > And after CSE:
 > 
 > bb0:
 >   p61 <= [4] ; can_trap to bb ??
 > bb1:
 > 
 > Ok, without more context this looks clearly wrong.  Before CSE p61 will
 > definitely not be set when bb0 is left with an exception, but after CSE
 > p61 will be set (or at least clobbered) in every case.  Can you provide
 > more context (esp. the initial =0 assignment to nn, the catch block, and
 > the block after the try/catch (the one using nn)?)

Right, here's the unexpurgated dump just before CSE.

insn 22 sets nn to zero.  The catch block starts at insn 46.  The
block after the try/catch starts at insn 60.  The test of nn is insn
62.

Andrew.


(insn 17 16 21 0 0x4022a86c (set (reg/v:QI 59)
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(note 21 17 22 0 ("Array_3.java") 47)

(insn 22 21 27 0 0x4022a814 (set (reg/v:SI 61)
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(note 27 22 28 0 ("Array_3.java") 64)

(insn 28 27 30 0 0x40228554 (set (reg/v/f:SI 63)
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(note 30 28 33 0 ("Array_3.java") 66)

(insn 33 30 233 0 0x402284a4 (set (reg/v:SI 65)
        (mem/s:SI (plus:SI (reg/v/f:SI 63)
                (const_int 4 [0x4])) [15 <variable>.length+0 S4 A32])) -1 (nil)
    (expr_list:REG_EH_REGION (const_int 1 [0x1])
        (nil)))
;; End of basic block 0, registers live:
 (nil)

;; Start of basic block 1, registers live: (nil)
(note 233 33 35 1 [bb 1] NOTE_INSN_BASIC_BLOCK)

(insn 35 233 39 1 0x40228554 (set (reg/v:SI 61)
        (reg/v:SI 65)) -1 (nil)
    (nil))

(jump_insn 39 35 40 1 0x4022a814 (set (pc)
        (label_ref 58)) -1 (nil)
    (nil))
;; End of basic block 1, registers live:
 (nil)

(barrier 40 39 295)

;; Start of basic block 2, registers live: (nil)
(code_label/s 295 40 298 2 27 "" [1 uses])

(note 298 295 296 2 [bb 2] NOTE_INSN_BASIC_BLOCK)

(insn 296 298 297 2 (nil) (set (reg:SI 68)
        (reg:SI 0 eax)) -1 (nil)
    (nil))

(insn 297 296 276 2 (nil) (set (reg:SI 105)
        (reg:SI 1 edx)) -1 (nil)
    (nil))

(insn 276 297 277 2 (nil) (set (reg:CCZ 17 flags)
        (compare:CCZ (reg:SI 105)
            (const_int 1 [0x1]))) -1 (nil)
    (nil))

(jump_insn 277 276 300 2 (nil) (set (pc)
        (if_then_else (eq (reg:CCZ 17 flags)
                (const_int 0 [0x0]))
            (label_ref 42)
            (pc))) -1 (nil)
    (nil))
;; End of basic block 2, registers live:
 (nil)

;; Start of basic block 3, registers live: (nil)
(note 300 277 286 3 [bb 3] NOTE_INSN_BASIC_BLOCK)

(insn 286 300 287 3 (nil) (set (mem:SI (reg/f:SI 7 esp) [0 S4 A8])
        (reg:SI 68)) 38 {*movsi_1} (nil)
    (nil))

(call_insn 287 286 288 3 (nil) (call (mem:QI (symbol_ref:SI ("_Unwind_Resume")) [0 S1 A8])
        (const_int 16 [0x10])) -1 (nil)
    (expr_list:REG_NORETURN (const_int 0 [0x0])
        (nil))
    (nil))
;; End of basic block 3, registers live:
 (nil)

(barrier 288 287 279)

(barrier 279 288 42)

;; Start of basic block 4, registers live: (nil)
(code_label/s 42 279 234 4 7 "" [2 uses])

(note 234 42 45 4 [bb 4] NOTE_INSN_BASIC_BLOCK)

(note 45 234 46 4 ("Array_3.java") 68)

(insn 46 45 50 4 0x402288c4 (set (reg/v/f:SI 67)
        (mem:SI (plus:SI (reg:SI 68)
                (const_int -4 [0xfffffffc])) [3 S4 A32])) -1 (nil)
    (nil))

(note 50 46 51 4 ("Array_3.java") 70)

(insn 51 50 58 4 0x4022886c (set (reg/v:QI 59)
        (const_int 1 [0x1])) -1 (nil)
    (nil))
;; End of basic block 4, registers live:
 (nil)

;; Start of basic block 5, registers live: (nil)
(code_label 58 51 235 5 6 "" [1 uses])

(note 235 58 59 5 [bb 5] NOTE_INSN_BASIC_BLOCK)

(note 59 235 60 5 ("Array_3.java") 72)

(insn 60 59 61 5 0x4022a814 (set (reg:CCZ 17 flags)
        (compare:CCZ (reg/v:QI 59)
            (const_int 0 [0x0]))) -1 (nil)
    (nil))

(jump_insn 61 60 236 5 0x4022a814 (set (pc)
        (if_then_else (eq (reg:CCZ 17 flags)
                (const_int 0 [0x0]))
            (label_ref 66)
            (pc))) -1 (nil)
    (expr_list:REG_BR_PRED (concat (const_int 8 [0x8])
            (const_int 100 [0x64]))
        (nil)))
;; End of basic block 5, registers live:
 (nil)

;; Start of basic block 6, registers live: (nil)
(note 236 61 62 6 [bb 6] NOTE_INSN_BASIC_BLOCK)

(insn 62 236 63 6 0x4022a814 (set (reg:CCZ 17 flags)
        (compare:CCZ (reg/v:SI 61)
            (const_int 0 [0x0]))) -1 (nil)
    (nil))

(jump_insn 63 62 66 6 0x4022a814 (set (pc)
        (if_then_else (eq (reg:CCZ 17 flags)
                (const_int 0 [0x0]))
            (label_ref 84)
            (pc))) 356 {*jcc_1} (nil)
    (nil))
;; End of basic block 6, registers live:
 (nil)


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