summaryrefslogtreecommitdiffstats
path: root/gcc/config/m32c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/m32c')
-rw-r--r--gcc/config/m32c/blkmov.md4
-rw-r--r--gcc/config/m32c/m32c.c9
-rw-r--r--gcc/config/m32c/m32c.h23
-rw-r--r--gcc/config/m32c/prologue.md7
4 files changed, 20 insertions, 23 deletions
diff --git a/gcc/config/m32c/blkmov.md b/gcc/config/m32c/blkmov.md
index e384d3c52b5..a5345ceef08 100644
--- a/gcc/config/m32c/blkmov.md
+++ b/gcc/config/m32c/blkmov.md
@@ -215,8 +215,8 @@
(define_expand "movstr"
[(match_operand 0 "m32c_nonimmediate_operand" "")
- (match_operand 1 "ap_operand" "")
- (match_operand 2 "ap_operand" "")
+ (match_operand 1 "" "")
+ (match_operand 2 "" "")
]
"TARGET_A24"
"if (m32c_expand_movstr(operands)) DONE; FAIL;"
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 055f34e9320..c603770ad60 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -4485,11 +4485,14 @@ m32c_emit_prologue (void)
void
m32c_emit_epilogue (void)
{
+ int popm_count = m32c_pushm_popm (PP_justcount);
+
/* This just emits a comment into the .s file for debugging. */
- if (m32c_pushm_popm (PP_justcount) > 0 || cfun->machine->is_interrupt)
+ if (popm_count > 0 || cfun->machine->is_interrupt)
emit_insn (gen_epilogue_start ());
- m32c_pushm_popm (PP_popm);
+ if (popm_count > 0)
+ m32c_pushm_popm (PP_popm);
if (cfun->machine->is_interrupt)
{
@@ -4546,7 +4549,6 @@ m32c_emit_epilogue (void)
emit_jump_insn (gen_epilogue_exitd_16 ());
else
emit_jump_insn (gen_epilogue_exitd_24 ());
- emit_barrier ();
}
void
@@ -4558,7 +4560,6 @@ m32c_emit_eh_epilogue (rtx ret_addr)
assembler, so punt to libgcc. */
emit_jump_insn (gen_eh_epilogue (ret_addr, cfun->machine->eh_stack_adjust));
/* emit_clobber (gen_rtx_REG (HImode, R0L_REGNO)); */
- emit_barrier ();
}
/* Indicate which flags must be properly set for a given conditional. */
diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h
index 7b5a5484582..6016ee56a13 100644
--- a/gcc/config/m32c/m32c.h
+++ b/gcc/config/m32c/m32c.h
@@ -201,7 +201,7 @@ machine_function;
#define WCHAR_TYPE "long int"
#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
+#define WCHAR_TYPE_SIZE 32
/* REGISTER USAGE */
@@ -288,19 +288,15 @@ machine_function;
{ 0x00000003 }, /* R02 - r0r2 */\
{ 0x0000000c }, /* R13 - r1r3 */\
{ 0x00000005 }, /* HL - r0 r1 */\
- { 0x00000005 }, /* QI - r0 r1 */\
{ 0x0000000a }, /* R23 - r2 r3 */\
{ 0x0000000f }, /* R03 - r0r2 r1r3 */\
- { 0x0000000f }, /* DI - r0r2r1r3 + mems */\
{ 0x00000010 }, /* A0 - a0 */\
{ 0x00000020 }, /* A1 - a1 */\
{ 0x00000030 }, /* A - a0 a1 */\
{ 0x000000f0 }, /* AD - a0 a1 sb fp */\
{ 0x000001f0 }, /* PS - a0 a1 sb fp sp */\
- { 0x0000000f }, /* SI - r0r2 r1r3 a0a1 */\
- { 0x0000003f }, /* HI - r0 r1 r2 r3 a0 a1 */\
{ 0x00000033 }, /* R02A - r0r2 a0 a1 */ \
- { 0x0000003f }, /* RA - r0..r3 a0 a1 */\
+ { 0x0000003f }, /* RA - r0 r1 r2 r3 a0 a1 */\
{ 0x0000007f }, /* GENERAL */\
{ 0x00000400 }, /* FLG */\
{ 0x000001ff }, /* HC - r0l r1 r2 r3 a0 a1 sb fb sp */\
@@ -311,9 +307,14 @@ machine_function;
{ 0x000ff00f }, /* R03_MEM */\
{ 0x000ff03f }, /* A_HI_MEM */\
{ 0x000ff0ff }, /* A_AD_CR_MEM_SI */\
- { 0x000ff1ff }, /* ALL */\
+ { 0x000ff5ff }, /* ALL */\
}
+#define QI_REGS HL_REGS
+#define HI_REGS RA_REGS
+#define SI_REGS R03_REGS
+#define DI_REGS R03_REGS
+
enum reg_class
{
NO_REGS,
@@ -328,17 +329,13 @@ enum reg_class
R02_REGS,
R13_REGS,
HL_REGS,
- QI_REGS,
R23_REGS,
R03_REGS,
- DI_REGS,
A0_REGS,
A1_REGS,
A_REGS,
AD_REGS,
PS_REGS,
- SI_REGS,
- HI_REGS,
R02A_REGS,
RA_REGS,
GENERAL_REGS,
@@ -370,17 +367,13 @@ enum reg_class
"R02_REGS", \
"R13_REGS", \
"HL_REGS", \
-"QI_REGS", \
"R23_REGS", \
"R03_REGS", \
-"DI_REGS", \
"A0_REGS", \
"A1_REGS", \
"A_REGS", \
"AD_REGS", \
"PS_REGS", \
-"SI_REGS", \
-"HI_REGS", \
"R02A_REGS", \
"RA_REGS", \
"GENERAL_REGS", \
diff --git a/gcc/config/m32c/prologue.md b/gcc/config/m32c/prologue.md
index 175b2b0ab9f..f4e62db1d75 100644
--- a/gcc/config/m32c/prologue.md
+++ b/gcc/config/m32c/prologue.md
@@ -88,14 +88,17 @@
(define_expand "eh_return"
[(match_operand:PSI 0 "" "")]
""
- "m32c_emit_eh_epilogue(operands[0]); DONE;"
+ "m32c_emit_eh_epilogue(operands[0]);
+ emit_barrier ();
+ DONE;"
)
(define_insn "eh_epilogue"
[(set (pc)
(unspec_volatile [(match_operand 0 "m32c_r1_operand" "")
(match_operand 1 "m32c_r0_operand" "")
- ] UNS_EH_EPILOGUE))]
+ ] UNS_EH_EPILOGUE))
+ (return)]
""
"jmp.a\t__m32c_eh_return"
[(set_attr "flags" "x")]
OpenPOWER on IntegriCloud