--- gcc/config/a29k/a29k.c 2018/04/24 18:21:48 1.1.1.3 +++ gcc/config/a29k/a29k.c 2018/04/24 18:29:19 1.1.1.4 @@ -1,5 +1,5 @@ /* Subroutines used for code generation on AMD Am29000. - Copyright (C) 1987, 88, 90, 91, 92, 93, 1994 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 90-94, 1995 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@nyu.edu) This file is part of GNU CC. @@ -16,7 +16,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include #include "config.h" @@ -220,7 +221,7 @@ spec_reg_operand (op, mode) return REGNO (op) >= R_BP && REGNO (op) <= R_CR; case MODE_INT: return REGNO (op) >= R_Q && REGNO (op) <= R_EXO; - detault: + default: return 0; } } @@ -806,8 +807,13 @@ incoming_reg (start, count) CLEAR_HARD_REG_BIT (call_fixed_reg_set, i); } - /* Shorten the maximum size of the frame. */ - for (i = R_AR (0) - start - count; i < R_AR (0) - start; i++) + /* Shorten the maximum size of the frame. + Remember that R_AR(-1,-2) are place holders for the caller's lr0,lr1. + Make sure to keep the frame rounded to an even boundary. Rounding up + to an 8 byte boundary will use a slot. Otherwise a frame with 121 local + regs and 5 arguments will overrun the stack (121+1 + 5 + 2 > 128). */ + /* ??? An alternative would be to never allocate one reg. */ + for (i = (R_AR (0) - 2 - start - count) & ~1; i < R_AR (0) - 2 - start; i++) { fixed_regs[i] = call_used_regs[i] = call_fixed_regs[i] = 1; SET_HARD_REG_BIT (fixed_reg_set, i); @@ -1098,7 +1104,7 @@ print_operand (file, x, code) { union real_extract u; - bcopy (&CONST_DOUBLE_LOW (x), &u, sizeof u); + bcopy ((char *) &CONST_DOUBLE_LOW (x), (char *) &u, sizeof u); fprintf (file, "$double1(%.20e)", u.d); } else if (GET_CODE (x) == REG) @@ -1162,7 +1168,8 @@ print_operand (file, x, code) fprintf (file, "$float"); else fprintf (file, "$double%d", SUBREG_WORD (XEXP (x, 0))); - bcopy (&CONST_DOUBLE_LOW (SUBREG_REG (XEXP (x, 0))), &u, sizeof u); + bcopy ((char *) &CONST_DOUBLE_LOW (SUBREG_REG (XEXP (x, 0))), + (char *) &u, sizeof u); fprintf (file, "(%.20e)", u.d); } @@ -1171,7 +1178,7 @@ print_operand (file, x, code) { union real_extract u; - bcopy (&CONST_DOUBLE_LOW (x), &u, sizeof u); + bcopy ((char *) &CONST_DOUBLE_LOW (x), (char *) &u, sizeof u); fprintf (file, "$%s(%.20e)", GET_MODE (x) == SFmode ? "float" : "double0", u.d); }