This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/16356] Failure to use count register (branch on count register)
- From: "rakdver at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jul 2004 01:23:54 -0000
- Subject: [Bug rtl-optimization/16356] Failure to use count register (branch on count register)
- References: <20040704061525.16356.anton@samba.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rakdver at gcc dot gnu dot org 2004-07-06 01:23 -------
What happens is that some pretty weird stuff is done with the counter of the
loop (reg 119) before it is incremented (later in bb 4), see below. I don't
quite understand what is the code is supposed to do.
The register 119 then of course is not recognized as an induction variable,
and doloop optimization cannot happen.
Zdenek
(insn 17 15 18 1 (parallel [
(set (reg:CC 123)
(compare:CC (and:DI (reg/v:DI 119 [ i ])
(const_int 2047 [0x7ff]))
(const_int 0 [0x0])))
(set (reg:DI 121)
(and:DI (reg/v:DI 119 [ i ])
(const_int 2047 [0x7ff])))
(clobber (scratch:CC))
]) -1 (nil)
(nil))
(insn 18 17 19 1 (set (reg:DI 122)
(ashiftrt:DI (reg/v:DI 119 [ i ])
(const_int 53 [0x35]))) -1 (nil)
(nil))
(insn 19 18 20 1 (set (reg:DI 122)
(plus:DI (reg:DI 122)
(const_int 1 [0x1]))) -1 (nil)
(nil))
(jump_insn 20 19 43 1 (set (pc)
(if_then_else (eq (reg:CC 123)
(const_int 0 [0x0]))
(label_ref 25)
(pc))) -1 (nil)
(expr_list:REG_BR_PROB (const_int 5000 [0x1388])
(nil)))
;; End of basic block 1, registers live:
(nil)
;; Start of basic block 2, registers live: (nil)
(note 43 20 21 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(insn 21 43 22 2 (set (reg:CCUNS 124)
(compare:CCUNS (reg:DI 122)
(const_int 2 [0x2]))) -1 (nil)
(nil))
(jump_insn 22 21 44 2 (set (pc)
(if_then_else (ltu (reg:CCUNS 124)
(const_int 0 [0x0]))
(label_ref 25)
(pc))) -1 (nil)
(expr_list:REG_BR_PROB (const_int 5000 [0x1388])
(nil)))
;; End of basic block 2, registers live:
(nil)
;; Start of basic block 3, registers live: (nil)
(note 44 22 23 3 [bb 3] NOTE_INSN_BASIC_BLOCK)
(insn 23 44 24 3 (set (reg/v:DI 119 [ i ])
(xor:DI (reg/v:DI 119 [ i ])
(reg:DI 121))) -1 (nil)
(nil))
(insn 24 23 25 3 (set (reg/v:DI 119 [ i ])
(ior:DI (reg/v:DI 119 [ i ])
(const_int 2048 [0x800]))) -1 (nil)
(nil))
;; End of basic block 3, registers live:
(nil)
;; Start of basic block 4, registers live: (nil)
(code_label 25 24 45 4 3 "" [2 uses])
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16356