summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-22 20:26:26 +0000
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-22 20:26:26 +0000
commitc3271fdb04f8f85e05e726ce72dc99c5dd82094c (patch)
treeaae9fef3887d712b43ee7f9d6e459b6f750cd145
parentf738f968a73ead625b351ad552f542b5637ef334 (diff)
downloadgcc-c3271fdb04f8f85e05e726ce72dc99c5dd82094c.tar.gz
* config/m32c/m32c.h (CLASS_MAX_NREGS): Remove macro.
* config/m32c/m32c-protos.h (m32c_class_max_nregs): Remove. * config/m32c/m32c.c (m32c_class_max_nregs): Make static. Change regclass argument type to reg_class_t. Change 'max' and 'v' vars and return types to unsigned char. Use reg_class_contents instead of class_contents. (TARGET_CLASS_MAX_NREGS): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177971 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/m32c/m32c-protos.h1
-rw-r--r--gcc/config/m32c/m32c.c17
-rw-r--r--gcc/config/m32c/m32c.h2
4 files changed, 21 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 09aa6711862..c8f66e0a24b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2011-08-22 Anatoly Sokolov <aesok@post.ru>
+
+ * config/m32c/m32c.h (CLASS_MAX_NREGS): Remove macro.
+ * config/m32c/m32c-protos.h (m32c_class_max_nregs): Remove.
+ * config/m32c/m32c.c (m32c_class_max_nregs): Make static. Change
+ regclass argument type to reg_class_t. Change 'max' and 'v' vars
+ and return types to unsigned char. Use reg_class_contents instead
+ of class_contents.
+ (TARGET_CLASS_MAX_NREGS): Define.
+
2011-08-22 Bernd Schmidt <bernds@codesourcery.com>
* config/c6x/c6x.md (indirect_jump_shadow): Tweak representation
diff --git a/gcc/config/m32c/m32c-protos.h b/gcc/config/m32c/m32c-protos.h
index eb242e0018f..9c247dcfd5b 100644
--- a/gcc/config/m32c/m32c-protos.h
+++ b/gcc/config/m32c/m32c-protos.h
@@ -44,7 +44,6 @@ int m32c_trampoline_size (void);
#ifdef RTX_CODE
int m32c_cannot_change_mode_class (enum machine_mode, enum machine_mode, int);
-int m32c_class_max_nregs (int, enum machine_mode);
rtx m32c_eh_return_stackadj_rtx (void);
void m32c_emit_eh_epilogue (rtx);
int m32c_expand_cmpstr (rtx *);
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 39d8ede0dee..7040df69fcf 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -859,18 +859,23 @@ m32c_class_likely_spilled_p (reg_class_t regclass)
return (reg_class_size[(int) regclass] == 1);
}
-/* Implements CLASS_MAX_NREGS. We calculate this according to its
+/* Implements TARGET_CLASS_MAX_NREGS. We calculate this according to its
documented meaning, to avoid potential inconsistencies with actual
class definitions. */
-int
-m32c_class_max_nregs (int regclass, enum machine_mode mode)
+
+#undef TARGET_CLASS_MAX_NREGS
+#define TARGET_CLASS_MAX_NREGS m32c_class_max_nregs
+
+static unsigned char
+m32c_class_max_nregs (reg_class_t regclass, enum machine_mode mode)
{
- int rn, max = 0;
+ int rn;
+ unsigned char max = 0;
for (rn = 0; rn < FIRST_PSEUDO_REGISTER; rn++)
- if (class_contents[regclass][0] & (1 << rn))
+ if (TEST_HARD_REG_BIT (reg_class_contents[(int) regclass], rn))
{
- int n = m32c_hard_regno_nregs (rn, mode);
+ unsigned char n = m32c_hard_regno_nregs (rn, mode);
if (max < n)
max = n;
}
diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h
index 8239aa0a3ff..00f8a2c52a1 100644
--- a/gcc/config/m32c/m32c.h
+++ b/gcc/config/m32c/m32c.h
@@ -425,8 +425,6 @@ enum reg_class
#define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
-#define CLASS_MAX_NREGS(C,M) m32c_class_max_nregs (C, M)
-
#define CANNOT_CHANGE_MODE_CLASS(F,T,C) m32c_cannot_change_mode_class(F,T,C)
#define CONST_OK_FOR_CONSTRAINT_P(VALUE,C,STR) \