From mboxrd@z Thu Jan 1 00:00:00 1970 From: pogde prashant To: Tom Tromey Cc: gcc@egcs.cygnus.com Subject: Need Help Date: Fri, 31 Dec 1999 23:54:00 -0000 Message-ID: References: <87g10ez91q.fsf@cygnus.com> X-SW-Source: 1999-12n/msg00068.html Message-ID: <19991231235400.wf9CpiJcA4OOgZKQ_CzBBeFiapAIQWXqJ4Q8KPgf5T8@z> Hii I was trying to port gcc to 8085. but the compiler that is generated crashes on some simple programs like case 1: main() { register int a; register int b; b=b+1; } though it works perfectly for case 2: main() { register int a; register int b; a=a+1; } the reason i figured out was : in my machine description file i have specified patterns for (define_insn "addqi3" [(set (match_operand:QI 0 "register_operand" "+a,a") (plus:QI (match_operand:QI 1 "register_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "i,r")))] "" "@ ADI %2 ADD %2 " ) where constraint "a" specifies that this operand must be in accumalator(reg no 0). and I also have pattern for all register to register move instructions. the rtl code that is generated for these two programs i m sending with this mail as an attachment. the problem is- (in first case )up to local register allocation compiler works perfectly it also generates correct rtl codes. but during "reload" phase it crashes.the reason is it assigns accumalator(reg 0) to first variable "a" and pseudo register no "2" to second variable before reload pass . Now during reload pass it should find out that the values are in wrong registers and add instruction pattern can not be applied on it. so it should generate some extra register to register mov instruction so that pattern for "add" instruction in the md file can be applied.but it is crashing in this phase. i have read just the documentation for how to port gcc to new architectures that comes with gcc package. I m not able to find out why the compiler is crashing. I would highly appreciate if u can guide me that how to find out and correct error in this case .can u plz also tell me if some other kind of patterns will be required in md file for this particular kind of translation.I think move patterns and pattern for add instruction should be sufficient.I have mapped all data types to 8bits. thanx and regards Prashant