This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH for H8/300]:Fix ICE for H8SX
- From: "Naveen H.S." <naveenh at KPITCummins dot com>
- To: "Kazu Hirata" <kazu at codesourcery dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 10 Jul 2006 11:30:43 +0530
- Subject: RE: [PATCH for H8/300]:Fix ICE for H8SX
Hi Kazu,
>> Sorry, I meant to ask what the insn looks in RTL. To see this,
>> you can use gdb. I'd like to see operands in the xorqi insn.
The RTL format of the instruction which cause ICE is as below.
;#(insn 14 13 15 (set (mem:QI (reg:SI 0 r0 [ ptrbVal ]) [0 S1 A8])
;# (xor:QI (mem:QI (reg:SI 0 r0 [ ptrbVal ]) [0 S1 A8])
;# (const_int 49 [0x31]))) 164 {xorqi3_1} (nil)
;# (expr_list:REG_DEAD (reg:SI 0 r0 [ ptrbVal ])
;# (nil)))
Bnot
The RTL format of the instruction after applying the patch is as below.
;#(insn 14 13 15 (set (mem:QI (reg:SI 0 r0 [ ptrbVal ]) [0 S1 A8])
;# (xor:QI (mem:QI (reg:SI 0 r0 [ ptrbVal ]) [0 S1 A8])
;# (const_int 49 [0x31]))) 164 {xorqi3_2} (nil)
;# (expr_list:REG_DEAD (reg:SI 0 r0 [ ptrbVal ])
;# (nil)))
xor #49,@er0 ;# 14 xorqi3_2/1 [length = 4]
The RTL format of the instruction without any patch and without any
optimization options enabled. So there will be no ICE generated. ICE
is generated only when any of the optimization option is passed.
;#(insn 12 11 13 (set (reg:QI 3 r3 [orig:17 D.1201 ] [17])
;# (xor:QI (reg:QI 3 r3 [orig:19 D.1199 ] [19])
;# (reg:QI 2 r2 [orig:18 D.1200 ] [18]))) 164 {xorqi3_2}
(nil)
;# (nil))
xor r2l,r3l ;# 12 xorqi3_2/1 [length = 2]
The message that is displayed when the ICE is generated is as follows:
"internal compiler error: in print_operand, at
config/h8300/h8300.c:1427"
The problem in this case is that the constraint (n) in the second
operand of the "XORQI3_1" produces ICE with the print_operand (V).
So if the constraint (n) is replaced by (IP1>X) as in the patch below
then the ICE can be eliminated generating proper instructions.
Please refer to the following link for the patch, and also the testcase
which is posted along with the patch.
http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01515.html
Regards,
Naveen.H.S.
KPIT Cummins Infosystems Ltd,
Pune (INDIA)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH, H8 and M16C
Series.
The following site also offers free technical support to its users.
Visit http://www.kpitgnutools.com for details.
Latest versions of KPIT GNU tools were released on June 1, 2006.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~