aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/vax/vax.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/vax/vax.c')
-rw-r--r--gcc/config/vax/vax.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index ad40e982..4f8ffb0 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA. */
#include "insn-attr.h"
#include "recog.h"
#include "expr.h"
+#include "optabs.h"
#include "flags.h"
#include "debug.h"
#include "tm_p.h"
@@ -43,6 +44,7 @@ Boston, MA 02111-1307, USA. */
static void vax_output_function_prologue (FILE *, HOST_WIDE_INT);
static void vax_file_start (void);
+static void vax_init_libfuncs (void);
static void vax_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree);
static int vax_address_cost_1 (rtx);
@@ -62,6 +64,9 @@ static bool vax_rtx_costs (rtx, int, int, int *);
#undef TARGET_ASM_FILE_START_APP_OFF
#define TARGET_ASM_FILE_START_APP_OFF true
+#undef TARGET_INIT_LIBFUNCS
+#define TARGET_INIT_LIBFUNCS vax_init_libfuncs
+
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK vax_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -141,6 +146,17 @@ vax_file_start (void)
fprintf (asm_out_file, "___vax_%c_doubles:\n", ASM_DOUBLE_CHAR);
}
+/* We can use the BSD C library routines for the libgcc calls that are
+ still generated, since that's what they boil down to anyways. When
+ ELF, avoid the user's namespace. */
+
+static void
+vax_init_libfuncs (void)
+{
+ set_optab_libfunc (udiv_optab, SImode, TARGET_ELF ? "*__udiv" : "*udiv");
+ set_optab_libfunc (umod_optab, SImode, TARGET_ELF ? "*__umod" : "*umod");
+}
+
/* This is like nonimmediate_operand with a restriction on the type of MEM. */
void