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

* RE: [AVR] Couple of tweaks
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Weddington, Eric @ 2011-04-18 16:34 UTC (permalink / raw)
  To: Eric Botcazou, gcc-patches
  Cc: Denis Chertykov, Anatoly Sokolov, Georg-Johann Lay



> -----Original Message-----
> From: Eric Botcazou [mailto:ebotcazou@adacore.com]
> Sent: Monday, April 18, 2011 4:57 AM
> To: gcc-patches@gcc.gnu.org
> Subject: [AVR] Couple of tweaks
> 
> 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.
> 
> 

Have you run the regression test suite for the AVR for this patch?

Eric Weddington

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

* Re: [AVR] Couple of tweaks
  2011-04-18 16:34 ` Weddington, Eric
@ 2011-05-08 13:02   ` Eric Botcazou
  2011-05-10 13:20     ` Denis Chertykov
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Botcazou @ 2011-05-08 13:02 UTC (permalink / raw)
  To: Weddington, Eric
  Cc: gcc-patches, Denis Chertykov, Anatoly Sokolov, Georg-Johann Lay

> Have you run the regression test suite for the AVR for this patch?

The compiler doesn't even build without the print_operand_address hunk...
I've installed this hunk as obvious to make some progress.

-- 
Eric Botcazou

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

* Re: [AVR] Couple of tweaks
  2011-05-08 13:02   ` Eric Botcazou
@ 2011-05-10 13:20     ` Denis Chertykov
  2011-05-10 13:59       ` Weddington, Eric
  2011-05-11  3:14       ` Eric Botcazou
  0 siblings, 2 replies; 9+ messages in thread
From: Denis Chertykov @ 2011-05-10 13:20 UTC (permalink / raw)
  To: Eric Botcazou
  Cc: Weddington, Eric, gcc-patches, Anatoly Sokolov, Georg-Johann Lay

2011/5/8 Eric Botcazou <ebotcazou@adacore.com>:
>> Have you run the regression test suite for the AVR for this patch?
>
> The compiler doesn't even build without the print_operand_address hunk...

Which compiler ?

Denis.

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

* RE: [AVR] Couple of tweaks
  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:14       ` Eric Botcazou
  1 sibling, 1 reply; 9+ messages in thread
From: Weddington, Eric @ 2011-05-10 13:59 UTC (permalink / raw)
  To: Denis Chertykov, Eric Botcazou
  Cc: gcc-patches, Anatoly Sokolov, Georg-Johann Lay



> -----Original Message-----
> From: Denis Chertykov [mailto:chertykov@gmail.com]
> Sent: Tuesday, May 10, 2011 5:42 AM
> To: Eric Botcazou
> Cc: Weddington, Eric; gcc-patches@gcc.gnu.org; Anatoly Sokolov; Georg-
> Johann Lay
> Subject: Re: [AVR] Couple of tweaks
> 
> 2011/5/8 Eric Botcazou <ebotcazou@adacore.com>:
> >> Have you run the regression test suite for the AVR for this patch?
> >
> > The compiler doesn't even build without the print_operand_address
> hunk...
> 
> Which compiler ?
> 

Hi Denis,

I think he's referring to the Ada compiler for AVR.

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

* Re: [AVR] Couple of tweaks
  2011-05-10 13:59       ` Weddington, Eric
@ 2011-05-10 15:30         ` Denis Chertykov
  2011-05-11  3:13           ` Eric Botcazou
  0 siblings, 1 reply; 9+ messages in thread
From: Denis Chertykov @ 2011-05-10 15:30 UTC (permalink / raw)
  To: Weddington, Eric
  Cc: Eric Botcazou, gcc-patches, Anatoly Sokolov, Georg-Johann Lay

2011/5/10 Weddington, Eric <Eric.Weddington@atmel.com>:
>
>
>> -----Original Message-----
>> From: Denis Chertykov [mailto:chertykov@gmail.com]
>> Sent: Tuesday, May 10, 2011 5:42 AM
>> To: Eric Botcazou
>> Cc: Weddington, Eric; gcc-patches@gcc.gnu.org; Anatoly Sokolov; Georg-
>> Johann Lay
>> Subject: Re: [AVR] Couple of tweaks
>>
>> 2011/5/8 Eric Botcazou <ebotcazou@adacore.com>:
>> >> Have you run the regression test suite for the AVR for this patch?
>> >
>> > The compiler doesn't even build without the print_operand_address
>> hunk...
>>
>> Which compiler ?
>>
>
> Hi Denis,
>
> I think he's referring to the Ada compiler for AVR.

Ohh, yes.
I'm worry about this:
>  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.

The port don't have to disable subregs in legitimate_address_p.
So, the current avr_legitimate_address_p is correct.
May be it's GCC core bug ?

Denis.

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

* Re: [AVR] Couple of tweaks
  2011-05-10 15:30         ` Denis Chertykov
@ 2011-05-11  3:13           ` Eric Botcazou
  2011-05-11  4:29             ` Weddington, Eric
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Botcazou @ 2011-05-11  3:13 UTC (permalink / raw)
  To: Denis Chertykov
  Cc: Weddington, Eric, gcc-patches, Anatoly Sokolov, Georg-Johann Lay

> The port don't have to disable subregs in legitimate_address_p.

They don't have not to disable them either, they do what's better for them.

> So, the current avr_legitimate_address_p is correct.

It's just making impossible to compile some code.

> May be it's GCC core bug ?

It's more of a reload limitation, it cannot find any spill register.

-- 
Eric Botcazou

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

* Re: [AVR] Couple of tweaks
  2011-05-10 13:20     ` Denis Chertykov
  2011-05-10 13:59       ` Weddington, Eric
@ 2011-05-11  3:14       ` Eric Botcazou
  1 sibling, 0 replies; 9+ messages in thread
From: Eric Botcazou @ 2011-05-11  3:14 UTC (permalink / raw)
  To: Denis Chertykov
  Cc: Weddington, Eric, gcc-patches, Anatoly Sokolov, Georg-Johann Lay

> Which compiler ?

The C compiler, see the first message in this thread...

-- 
Eric Botcazou

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

* RE: [AVR] Couple of tweaks
  2011-05-11  3:13           ` Eric Botcazou
@ 2011-05-11  4:29             ` Weddington, Eric
  0 siblings, 0 replies; 9+ messages in thread
From: Weddington, Eric @ 2011-05-11  4:29 UTC (permalink / raw)
  To: Eric Botcazou, Denis Chertykov
  Cc: gcc-patches, Anatoly Sokolov, Georg-Johann Lay



> -----Original Message-----
> From: Eric Botcazou [mailto:ebotcazou@adacore.com]
> Sent: Tuesday, May 10, 2011 2:43 PM
> To: Denis Chertykov
> Cc: Weddington, Eric; gcc-patches@gcc.gnu.org; Anatoly Sokolov; Georg-
> Johann Lay
> Subject: Re: [AVR] Couple of tweaks
> 
> > The port don't have to disable subregs in legitimate_address_p.
> 
> They don't have not to disable them either, they do what's better for
> them.
> 
> > So, the current avr_legitimate_address_p is correct.
> 
> It's just making impossible to compile some code.

Which code? Do you have a test case?

^ 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).