public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [AVR] Couple of tweaks
@ 2011-04-18 11:37 Eric Botcazou
  2011-04-18 16:34 ` Weddington, Eric
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Botcazou @ 2011-04-18 11:37 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

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  <ebotcazou@adacore.com>

	* config/avr/avr.c (avr_legitimate_address_p): Always reject SUBREGs.
	(print_operand_address): Fix invalid RTL manipulation.


-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-diff, Size: 1027 bytes --]

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 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-05-10 21:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-18 11:37 [AVR] Couple of tweaks Eric Botcazou
2011-04-18 16:34 ` Weddington, Eric
2011-05-08 13:02   ` Eric Botcazou
2011-05-10 13:20     ` Denis Chertykov
2011-05-10 13:59       ` Weddington, Eric
2011-05-10 15:30         ` Denis Chertykov
2011-05-11  3:13           ` Eric Botcazou
2011-05-11  4:29             ` Weddington, Eric
2011-05-11  3:14       ` Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).