Patch H8/300 target : Internal compiler error for plain h8/300 in Gcc 3.4 branch and mainline

Anil Paranjape AnilP1@KPITCummins.com
Fri Jun 4 14:20:00 GMT 2004


Hi,

Gcc 3.4 branch and mainline both produce internal compiler error (ICE) for plain H8300 target ,
Test case :
   int main()
   {
 	unsigned long ul;
 	signed char sch;
 	if(ul <= sch);
 	return 0;
   }

Compiled with 
h8300-*-gcc -c test.c 

The bug occurs when unsigned long / long is compared with signed char without using type cast for plain H8/300 target.
Following patch fixes this bug,

ChangeLog
2004-06-04 Anil Paranjpe <anilp1@kpitcummins.com>
	*h8300/h8300.md : In pattern "*extendqisi2_h8300", added constraints.

Patch text:
***************************************************************************************
--- gcc-3.4.0/gcc/config/h8300/h8300.md.old	Thu Jun  3 16:04:34 2004
+++ gcc-3.4.0/gcc/config/h8300/h8300.md	Thu Jun  3 16:05:59 2004
@@ -2449,7 +2449,7 @@
   "")
 
 (define_insn "*extendqisi2_h8300"
-  [(set (match_operand:SI 0 "register_operand" "")
+  [(set (match_operand:SI 0 "register_operand" "=r,r")
 	(sign_extend:SI (match_operand:QI 1 "general_operand_src" "0,g>")))]
   "TARGET_H8300"
   "@
***************************************************************************************

Regards,
Anil Paranjpe
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 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 are released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 



More information about the Gcc-patches mailing list