This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12508] weak optimization for some constants < 2^16
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Oct 2003 21:28:08 -0000
- Subject: [Bug optimization/12508] weak optimization for some constants < 2^16
- References: <20031004182021.12508.gpiez@users.sourceforge.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12508
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-10-04 21:28:08
date| |
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-10-04 21:28 -------
The difference is caused by the combine pass.
For the 0x1fff0 case:
(insn 9 4 43 0 (parallel [
(set (reg:SI 60)
(and:SI (reg/v:SI 59 [ x ])
(const_int 131056 [0x1fff0])))
(clobber (reg:CC 17 flags))
]) 213 {*andsi_1} (insn_list 3 (nil))
(expr_list:REG_DEAD (reg/v:SI 59 [ x ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
(insn 43 9 44 0 (set (reg:CCZ 17 flags)
(compare:CCZ (reg:SI 60)
(const_int 0 [0x0]))) 0 {*cmpsi_ccno_1} (insn_list 9 (nil))
(expr_list:REG_DEAD (reg:SI 60)
(nil)))
is changed into:
(insn 43 9 44 0 (set (reg:CCZ 17 flags)
(compare:CCZ (and:SI (mem/f:SI (reg/f:SI 16 argp) [2 x+0 S4 A32])
(const_int 131056 [0x1fff0]))
(const_int 0 [0x0]))) 206 {testsi_1} (nil)
(nil))
while on the hand the 0xfff0 case:
This is combined into (note the subreg):
(insn 11 4 12 0 (parallel [
(set (reg:SI 62)
(and:SI (reg/v:SI 59 [ x ])
(const_int -16 [0xfffffff0])))
(clobber (reg:CC 17 flags))
]) 213 {*andsi_1} (insn_list 3 (nil))
(expr_list:REG_DEAD (reg/v:SI 59 [ x ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
(insn 12 11 46 0 (set (reg:HI 63)
(subreg:HI (reg:SI 62) 0)) 42 {*movhi_1} (insn_list 11 (nil))
(expr_list:REG_DEAD (reg:SI 62)
(nil)))
(insn 46 12 47 0 (set (reg:CCZ 17 flags)
(compare:CCZ (reg:HI 63)
(const_int 0 [0x0]))) 3 {*cmphi_ccno_1} (insn_list 12 (nil))
(expr_list:REG_DEAD (reg:HI 63)
(nil)))
into:
(insn 11 4 12 0 (parallel [
(set (reg:SI 62)
(and:SI (mem/f:SI (reg/f:SI 16 argp) [2 x+0 S4 A32])
(const_int -16 [0xfffffff0])))
(clobber (reg:CC 17 flags))
]) 213 {*andsi_1} (nil)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))
(note 12 11 46 0 NOTE_INSN_DELETED)
(insn 46 12 47 0 (set (reg:CCZ 17 flags)
(compare:CCZ (subreg:HI (reg:SI 62) 0)
(const_int 0 [0x0]))) 3 {*cmphi_ccno_1} (insn_list 11 (nil))
(expr_list:REG_DEAD (reg:SI 62)
(nil)))