This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
small patch for a29k
- To: gcc-patches at gcc dot gnu dot org
- Subject: small patch for a29k
- From: Andrew Macleod <amacleod at cygnus dot com>
- Date: Wed, 7 Mar 2001 12:25:38 -0800
I'm checking in the following changes which are required to get the a29k
target to compile. oballoc needs to be replaced with xmalloc and free, and
'shift_constant_operand' is static to a29k.c so having it in the
PREDICATE_CODES causes a function proototype to be declared which conflicts
with the actual function.
Approved by rth.
Andrew
* config/a29k/a29k.c (print_operand): Free a29k_last_prologue_insn
after its emitted.
(output_prologue): Use xmalloc not oballoc.
(output_epilog): Free a29k_first_epilogue_insn when finished.
* confif/a29k/a29k.h (PREDICATE_CODES): Remove shift_constant_operand.
Index: config/a29k/a29k.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/a29k/a29k.c,v
retrieving revision 1.12
diff -c -p -r1.12 a29k.c
*** a29k.c 2000/11/09 07:45:14 1.12
--- a29k.c 2001/03/06 21:01:20
*************** print_operand (file, x, code)
*** 1082,1087 ****
--- 1082,1088 ----
else if (a29k_last_prologue_insn)
{
fprintf (file, "\n\t%s", a29k_last_prologue_insn);
+ free (a29k_last_prologue_insn);
a29k_last_prologue_insn = 0;
}
else if (optimize && flag_delayed_branch
*************** print_operand (file, x, code)
*** 1105,1110 ****
--- 1106,1112 ----
if (a29k_last_prologue_insn)
{
fprintf (file, "\n\t%s", a29k_last_prologue_insn);
+ free (a29k_last_prologue_insn);
a29k_last_prologue_insn = 0;
}
else if (GET_CODE (x) == SYMBOL_REF
*************** print_operand (file, x, code)
*** 1159,1164 ****
--- 1161,1167 ----
if (a29k_last_prologue_insn)
{
fprintf (file, "\n\t%s", a29k_last_prologue_insn);
+ free (a29k_last_prologue_insn);
a29k_last_prologue_insn = 0;
}
else
*************** output_prolog (file, size)
*** 1387,1393 ****
if (num_delay_slots (insn) > 0)
{
! a29k_last_prologue_insn = (char *) oballoc (100);
sprintf (a29k_last_prologue_insn, "add lr1,gr1,%d", i);
break;
}
--- 1390,1396 ----
if (num_delay_slots (insn) > 0)
{
! a29k_last_prologue_insn = (char *) xmalloc (100);
sprintf (a29k_last_prologue_insn, "add lr1,gr1,%d", i);
break;
}
*************** output_prolog (file, size)
*** 1404,1410 ****
if (size == 0 && a29k_regstack_size == 0 && ! frame_pointer_needed)
a29k_first_epilogue_insn = 0;
else
! a29k_first_epilogue_insn = (char *) oballoc (100);
if (frame_pointer_needed)
sprintf (a29k_first_epilogue_insn, "sll %s,%s,0",
--- 1407,1413 ----
if (size == 0 && a29k_regstack_size == 0 && ! frame_pointer_needed)
a29k_first_epilogue_insn = 0;
else
! a29k_first_epilogue_insn = (char *) xmalloc (100);
if (frame_pointer_needed)
sprintf (a29k_first_epilogue_insn, "sll %s,%s,0",
*************** output_epilog (file, size)
*** 1547,1550 ****
--- 1550,1557 ----
file, 1, -2, 1);
else
fprintf (file, "\tnop\n");
+
+ if (a29k_first_epilogue_insn)
+ free (a29k_first_epilogue_insn);
+ a29k_first_epilogue_insn = 0;
}
Index: config/a29k/a29k.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/a29k/a29k.h,v
retrieving revision 1.18
diff -c -p -r1.18 a29k.h
*** a29k.h 2001/01/01 20:35:26 1.18
--- a29k.h 2001/03/06 21:01:21
*************** extern int a29k_debug_reg_map[];
*** 1635,1641 ****
{"cint_16_operand", {CONST_INT}}, \
{"long_const_operand", {CONST_INT, CONST, CONST_DOUBLE, \
LABEL_REF, SYMBOL_REF}}, \
- {"shift_constant_operand", {CONST_INT, ASHIFT}}, \
{"const_0_operand", {CONST_INT, ASHIFT}}, \
{"const_8_operand", {CONST_INT, ASHIFT}}, \
{"const_16_operand", {CONST_INT, ASHIFT}}, \
--- 1635,1640 ----