Hi, attached is a couple of tweaks to the AVR back-end that we have in our tree:
1. libgcc cannot be built with RTL checking; the error is /home/eric/svn/gcc/libgcc/../gcc/unwind-dw2-fde.c: In function 'search_object': /home/eric/svn/gcc/libgcc/../gcc/unwind-dw2-fde.c:992:1: internal compiler error: RTL check: expected elt 0 type 'e' or 'u', have 's' (rtx symbol_ref) in print_operand_address, at config/avr/avr.c:1310 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. make[4]: *** [unwind-dw2-fde.o] Error 1 This is an invalid RTL manipulation in print_operand_address. 2. avr_legitimate_address_p accepts SUBREGs in addresses in non-strict mode. This can make the job of reload impossible given the scarcity of POINTER_REGS, for example for "fat pointer" types in Ada, which are structures made up of 2 pointers and aligned enough to have SImode. Lightly tested on the mainline, but we use them in production for our 4.5-based compiler. OK for the mainline? 2011-04-18 Eric Botcazou <ebotca...@adacore.com> * config/avr/avr.c (avr_legitimate_address_p): Always reject SUBREGs. (print_operand_address): Fix invalid RTL manipulation. -- Eric Botcazou
Index: config/avr/avr.c =================================================================== --- config/avr/avr.c (revision 172617) +++ config/avr/avr.c (working copy) @@ -1162,8 +1162,8 @@ avr_legitimate_address_p (enum machine_m true_regnum (XEXP (x, 0))); debug_rtx (x); } - if (!strict && GET_CODE (x) == SUBREG) - x = SUBREG_REG (x); + /* Even in non-strict mode, reject SUBREGs because they can make the job + of reload impossible given the scarcity of POINTER_REGS. */ if (REG_P (x) && (strict ? REG_OK_FOR_BASE_STRICT_P (x) : REG_OK_FOR_BASE_NOSTRICT_P (x))) r = POINTER_REGS; @@ -1307,7 +1307,9 @@ print_operand_address (FILE *file, rtx a if (CONSTANT_ADDRESS_P (addr) && text_segment_operand (addr, VOIDmode)) { - rtx x = XEXP (addr,0); + rtx x = addr; + if (GET_CODE (x) == CONST) + x = XEXP (x, 0); if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x,1)) == CONST_INT) { /* Assembler gs() will implant word address. Make offset