Re: porting gcc to new arch: unrecognizable insn

2010-08-02 Thread Dave Korn
On 01/08/2010 16:26, Gabor Kerenyi wrote:

 I'm porting GCC 4.4.4 to a new arch and while cross-compiling libgcc I get 
 the 
 following error:
 ../../../libgcc/../gcc/libgcc2.c: In function ‘__clzsi2’:
 ../../../libgcc/../gcc/libgcc2.c:716: error: unrecognizable insn:
 (insn 49 48 50 16 ../../../libgcc/../gcc/libgcc2.c:713 (set (reg:QI 25)
 (mem/s/u/j:QI (plus:SI (reg/f:SI 22)
 (reg:SI 23)) [0 __clz_tab S1 A8])) -1 (nil))
 ../../../libgcc/../gcc/libgcc2.c:716: internal compiler error: in 
 extract_insn, at recog.c:2048
 Please submit a full bug report,
 
 If I understand correctly it complains about a move instruction where src 
 memory location should be (reg22+reg23). My arch defines:
 #define MAX_REGS_PER_ADDRESS 1
 the first pseudo reg is 13
 
 So I don't really understand why it tries to use such a pattern.

  I think the wording of the second sentence in the M_R_P_A documentation
(beginning 'Note that ...'):

 -- Macro: MAX_REGS_PER_ADDRESS
 A number, the maximum number of registers that can appear in a
 valid memory address.  Note that it is up to you to specify a
 value equal to the maximum number that
 `TARGET_LEGITIMATE_ADDRESS_P' would ever accept.

... is meant to imply that you /also/ need to reject such address patterns in
TARGET_LEGITIMATE_ADDRESS_P, i.e. M_R_P_A only /informs/ the compiler of the
most registers that will be in any address that T_L_A_P ends up accepting, it
doesn't set a limit on what the compiler will ask T_L_A_P to decide if it's ok
or not.

cheers,
  DaveK




Re: porting gcc to new arch: unrecognizable insn

2010-08-02 Thread Gabor Kerenyi
  If I understand correctly it complains about a move instruction where src
  memory location should be (reg22+reg23). My arch defines:
  #define MAX_REGS_PER_ADDRESS 1
  the first pseudo reg is 13
  
 
   I think the wording of the second sentence in the M_R_P_A documentation
 (beginning 'Note that ...'):
 
  -- Macro: MAX_REGS_PER_ADDRESS
  A number, the maximum number of registers that can appear in a
  valid memory address.  Note that it is up to you to specify a
  value equal to the maximum number that
  `TARGET_LEGITIMATE_ADDRESS_P' would ever accept.

Yeah I finally found that yesterday. Sorry that I could not find it in the docs 
before ;) It's open all the time but I just slipped through it...
I don't really understand why this define exists anyway if finally only the 
LEGITIMATE_ADDRESS_P matters.
The doc doesn't say (or at least I could not find it) what it is good for, if 
it is not the decision maker piece.

Anyway, the libgcc is cross compiled. The only problem I face now that two 
object files do not compile with -O or -O2 switch. There is an ICE in 
reload_combine_not_use. But I'll try to figure that out.

Thank,
Gabor