avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] reproducable gcc error: unrecognizable insn


From: Denis Chertykov
Subject: Re: [avr-gcc-list] reproducable gcc error: unrecognizable insn
Date: 09 Sep 2002 22:46:24 +0400
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Oliver Kasten <address@hidden> writes:

> i get the following reproducable error:
> 
> avr-gcc -mmcu=atmega128 -O6 -Wall -c insn.c 
> insn.c: In function `foo':
> insn.c:18: unrecognizable insn:
> (insn 11 9 13 (set (reg:QI 42)
>         (const_int 129 [0x81])) -1 (nil)
>     (expr_list:REG_EQUAL (const_int 129 [0x81])
>         (nil)))
> insn.c:18: Internal compiler error in extract_insn, at recog.c:2148

Thanks for bug report.

This is the fix. (FSF CVS tree already have this fix)
Apply the following patch to gcc/config/avr/avr.md and recompile
avr-gcc.


*** avr.md      13 Aug 2002 14:06:56 -0000      1.35
--- avr.md      9 Sep 2002 17:54:42 -0000
***************
*** 356,368 ****
    "{
    rtx addr0, addr1;
    int cnt8;
  
    if (GET_CODE (operands[2]) != CONST_INT)
      FAIL;
!   cnt8 = byte_immediate_operand (operands[2], GET_MODE (operands[2]));
!   operands[2] = copy_to_mode_reg (cnt8 ? QImode : HImode, operands[2]);
!   operands[4] = operands[2];
! 
    addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
    addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
  
--- 356,369 ----
    "{
    rtx addr0, addr1;
    int cnt8;
+   enum machine_mode mode;
  
    if (GET_CODE (operands[2]) != CONST_INT)
      FAIL;
!   cnt8 = byte_immediate_operand (operands[1], GET_MODE (operands[1]));
!   mode = cnt8 ? QImode : HImode;
!   operands[1] = copy_to_mode_reg (mode,
!                                   gen_int_mode (INTVAL (operands[1]), mode));
    addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
    addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
  
***************
*** 428,439 ****
    "{
    rtx addr0;
    int cnt8;
  
    if (GET_CODE (operands[1]) != CONST_INT)
      FAIL;
  
    cnt8 = byte_immediate_operand (operands[1], GET_MODE (operands[1]));
!   operands[1] = copy_to_mode_reg (cnt8 ? QImode : HImode, operands[1]);
    operands[3] = operands[1];
  
    addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
--- 429,443 ----
    "{
    rtx addr0;
    int cnt8;
+   enum machine_mode mode;
  
    if (GET_CODE (operands[1]) != CONST_INT)
      FAIL;
  
    cnt8 = byte_immediate_operand (operands[1], GET_MODE (operands[1]));
!   mode = cnt8 ? QImode : HImode;
!   operands[1] = copy_to_mode_reg (mode,
!                                   gen_int_mode (INTVAL (operands[1]), mode));
    operands[3] = operands[1];
  
    addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));

avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]