public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix cris/crisv32 port
@ 2017-04-12 14:59 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2017-04-12 14:59 UTC (permalink / raw)
  To: gcc-patches

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

The cris ports are unable to build newlib due to a reload failure.

What happens is we need to reload an auto-inc memory reference.   The 
preferred class is GENERAL_REGS.  THe register we happen to select is 
ACR, but ACR can not be used in an auto-inc addressing mode.

This can be easily fixed by returning GENNONACR_REGS from the preferred 
reload class hook instead of GENERAL_REGS.

It may be advisable to also define the LIMIT_RELOAD_CLASS hook.  I 
haven't done that, but the port maintainers should seriously consider it.

With this change cris and crisv32 both build newlib successfully.

Installed on the trunk.

Jeff

[-- Attachment #2: P --]
[-- Type: text/plain, Size: 413 bytes --]

diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 21137bd..8c134a6 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -1597,7 +1597,7 @@ cris_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, reg_class_t rclass)
       && rclass != SRP_REGS
       && rclass != CC0_REGS
       && rclass != SPECIAL_REGS)
-    return GENERAL_REGS;
+    return GENNONACR_REGS;
 
   return rclass;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-12 14:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 14:59 Fix cris/crisv32 port Jeff Law

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