This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Errors while porting for a new processor





>> From:  gcc-patches-owner@gcc.gnu.org
>> Posted on:  10/15/01 12:42:15 PM
>> To :        gcc-patches@gcc.gnu.org
>> Cc :
>> Subject :   Errors while porting for a new processor

>> Hi GNU-team,
>> I am facing two problems while trying to build a cross compiler
>> for a new processor.
>>     which has register
>>         R13 as link register,
>>         R14 as stack pointer and
>>         R15 as program counter
>>
>> The two problems which I face are as below
>>
>> #1
>> I have writien the md file and defined the target macros as
>> required. When I try to build the cross compiler fully, it fails at
>> compiling the libgcc2.c with the builtup xgcc - saying
>>
>> ./libgcc2.c:305: Internal compiler error in 'canon_hash', at cse.c:2269
>>
>> May anyone help me in fixing the error.
>>
>> #2
>> When I try to get the assembly dump of a sample - simple program
>>     main()
>>     {
>>         int i,j,k;
>>         i = 5;
>>         j = 10;
>>
>>         k=i+j;
>>     }
>>
>> it gives me an error saying
>>     internal error-unrecognizable insn:
>>         (call_insn    7    6    9    (parallel    [
>>                                     (call    (mem:SI (symbol_ref:SI ("
>> __main")) 0)
>>                                                     (const_int 0 [0x0]
))
>>                                         (clobber (reg:SI 13 %R13))
>>                         ]    )    -1    (nil)
>>                     (nil)
>>                     (nil))
>>
>> I have defined the machine descriptions as follows.
>>
>>         (define_expand "call"
>>                 [ ( parallel [ ( call(match_operand 0 "memory_operand"
"")
>>                         (match_operand   1 "general_operand" ""))
>>                             (clobber (reg:SI 13))] )]
>>                     ""
>>                     "")
>>
>>         (define_insn "*call_mem"
>>                 [ ( call (mem: SI (match_operand:SI 0 "memory_operand"
>> "m"))
>>                         (const_int 0))
>>                     (clobber (reg:SI    13))]
>>                 "GET_CODE(operands[1]) == SYMBOL_REF"
>>                 "b\\t%0"
>>         )

Your problem is that you are checking operands[1] for SYMBOL_REF when you
should be checking operands[0]. Additionally your predicate for operand 0,
should not be 'memory_operand'. You have already specified the 'mem'. The
first thing that the 'memory_operand' predicate checks for is a 'MEM'
operator. The predicate (which you will have to write yourself) should
check that operand 0 is a symbol_ref. This will eliminate the need to write
a condition which checks for the same thing.

>>
>> Do I have to define any other pattern to get rid off this error? / is
there
>> any other
>> way to resolve this?
>>

Michael Collison
collison@isisinc.net



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]