From 591eb4baa804e96d82d1efe46ac363f1972b6e00 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Thu, 20 Jul 2000 21:27:15 +0000 Subject: [PATCH] Fix out-of-range immediate for large thunk offset. * config/ia64/ia64.h (ASM_OUTPUT_MI_THUNK): Handle DELTA values larger than 14 bits. From-SVN: r35154 --- gcc/ChangeLog | 5 +++++ gcc/config/ia64/ia64.h | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index af27727cad2..6d316d28cac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-07-20 Jim Wilson + + * config/ia64/ia64.h (ASM_OUTPUT_MI_THUNK): Handle DELTA values + larger than 14 bits. + 2000-07-20 Zack Weinberg * cppmacro.c (CAN_PASTE_AFTER): New macro. diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index 1d64e53a34b..f4fa27af99e 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -1486,12 +1486,19 @@ do { \ /* A C compound statement that outputs the assembler code for a thunk function, used to implement C++ virtual function calls with multiple inheritance. */ -/* ??? This only supports deltas up to 14 bits. If we need more, then we - must load the delta into a register first. */ - #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ do { \ - fprintf (FILE, "\tadd r32 = %d, r32\n", (DELTA)); \ + if (CONST_OK_FOR_I (DELTA)) \ + fprintf (FILE, "\tadds r32 = %d, r32\n", (DELTA)); \ + else \ + { \ + if (CONST_OK_FOR_J (DELTA)) \ + fprintf (FILE, "\taddl r2 = %d, r0\n", (DELTA)); \ + else \ + fprintf (FILE, "\tmovl r2 = %d\n", (DELTA)); \ + fprintf (FILE, "\t;;\n"); \ + fprintf (FILE, "\tadd r32 = r2, r32\n"); \ + } \ fprintf (FILE, "\tbr "); \ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \ fprintf (FILE, "\n"); \