This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: Have ira-conflicts.c use base_reg_class()


Hi Bernd,

  The bfin port is not currently building in the gcc mainline because
  ira-conflicts.c needs a definition of BASE_REGS_CLASS.  The patch
  below adds one, although I am not 100% sure that I have used the
  right value.

IMO ira-conflicts.c needs to be fixed to accept MODE_CODE_BASE_REG_CLASS like everything else.

Thanks for trying to fix this, but this patch is clearly wrong.

Fair enough - in which case please could you review the attached patch. It changes ira-conflicts.c to use the base_reg_class() inline function defined in addresses.h which will use MODE_CODE_BASE_REG_CLASS if it is defined. I had to guess at the parameters to pass to base_reg_class() but I think their exact values will not matter too much.


Tested by rebuilding a lot of toolchains[1], including bfin-elf and by preforming a regression test of the gcc testsuite for an i686-pc-linux-gnu toolchain. (There were no regressions).

OK to apply ?

Cheers
  Nick

gcc/ChangeLog
2009-01-13  Nick Clifton  <nickc@redhat.com>

	* ira-conflicts.c: Include addresses.h for the definition of
	base_reg_class.
	(ira_build_conflicts): Use base_reg_class instead of
	BASE_REG_CLASS.
	* Makefile.in: Add a dependency of ira-conflicts.o on
	addresses.h.


[1]: To be exact: h8300-elf m68hc12-elf arc-elf mn10300-elf spu-elf xstormy16-elf fr30-elf v850e-elf arm-wince-pe arm-epoc-pe avr-elf i386-elf m32c-elf mcore-elf mcore-pe mips64vr-elf arm-eabi arm-elf arm-pe bfin-elf cris-elf frv-elf ia64-elf iq2000-elf m32r-elf mipsisa32-elf mipsisa64-elf mmix-mmixware powerpc-eabispe powerpc-elf sh64-elf sh-elf sh-symbianelf tx39-elf x86_64-pc-linux-gnu i686-pc-linux-gnu alpha-netbsd am33_2.0-linux frv-uclinux hppa64-hp-hpux11.11 hppa-linux-gnu powerpc-ibm-aix4.3.3.0 powerpc64-linux-gnu vax-netbsdelf i686-pc-cygwin mingw32-pe ppc-linux s390-linux
Index: gcc/ira-conflicts.c
===================================================================
--- gcc/ira-conflicts.c	(revision 143204)
+++ gcc/ira-conflicts.c	(working copy)
@@ -37,6 +37,7 @@
 #include "df.h"
 #include "sparseset.h"
 #include "ira-int.h"
+#include "addresses.h"
 
 /* This file contains code responsible for allocno conflict creation,
    allocno copy creation and allocno info accumulation on upper level
@@ -788,7 +789,7 @@
 	  ira_free (conflicts);
 	}
     }
-  if (! CLASS_LIKELY_SPILLED_P (BASE_REG_CLASS))
+  if (! CLASS_LIKELY_SPILLED_P (base_reg_class (VOIDmode, REG, REG)))
     CLEAR_HARD_REG_SET (temp_hard_reg_set);
   else
     {
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 143204)
+++ gcc/Makefile.in	(working copy)
@@ -2926,7 +2926,7 @@
 ira-conflicts.o: ira-conflicts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TARGET_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
    insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(PARAMS_H) \
-   $(DF_H) sparseset.h $(IRA_INT_H)
+   $(DF_H) sparseset.h addresses.h $(IRA_INT_H)
 ira-color.o: ira-color.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TARGET_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
    $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(PARAMS_H) \

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]