From: Kazu Hirata Date: Tue, 17 Sep 2002 19:02:58 +0000 (+0000) Subject: optabs.c (prepare_cmp_insn): Let emit_library_call_value generate a pseudo reg that... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=24491a09505847e6e42b50917948ac5dc5780715;p=gcc.git optabs.c (prepare_cmp_insn): Let emit_library_call_value generate a pseudo reg that receives the result of a... * optabs.c (prepare_cmp_insn): Let emit_library_call_value generate a pseudo reg that receives the result of a libcall. (prepare_float_lib_cmp): Likewise. From-SVN: r57255 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index debee294ac5..34852fe2cc3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-09-17 Kazu Hirata + + * optabs.c (prepare_cmp_insn): Let emit_library_call_value + generate a pseudo reg that receives the result of a libcall. + (prepare_float_lib_cmp): Likewise. + 2002-09-17 Steve Ellcey * config/ia64/elf.h: Remove CPP_PREDEFINES. diff --git a/gcc/optabs.c b/gcc/optabs.c index 7ceec122ff1..0d13bb144f1 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -3436,29 +3436,23 @@ prepare_cmp_insn (px, py, pcomparison, size, pmode, punsignedp, purpose) #endif { #ifdef TARGET_MEM_FUNCTIONS - emit_library_call (memcmp_libfunc, LCT_PURE_MAKE_BLOCK, - TYPE_MODE (integer_type_node), 3, - XEXP (x, 0), Pmode, XEXP (y, 0), Pmode, - convert_to_mode (TYPE_MODE (sizetype), size, - TREE_UNSIGNED (sizetype)), - TYPE_MODE (sizetype)); + result = emit_library_call_value (memcmp_libfunc, NULL_RTX, LCT_PURE_MAKE_BLOCK, + TYPE_MODE (integer_type_node), 3, + XEXP (x, 0), Pmode, XEXP (y, 0), Pmode, + convert_to_mode (TYPE_MODE (sizetype), size, + TREE_UNSIGNED (sizetype)), + TYPE_MODE (sizetype)); #else - emit_library_call (bcmp_libfunc, LCT_PURE_MAKE_BLOCK, - TYPE_MODE (integer_type_node), 3, - XEXP (x, 0), Pmode, XEXP (y, 0), Pmode, - convert_to_mode (TYPE_MODE (integer_type_node), - size, - TREE_UNSIGNED (integer_type_node)), - TYPE_MODE (integer_type_node)); + result = emit_library_call_value (bcmp_libfunc, NULL_RTX, LCT_PURE_MAKE_BLOCK, + TYPE_MODE (integer_type_node), 3, + XEXP (x, 0), Pmode, XEXP (y, 0), Pmode, + convert_to_mode (TYPE_MODE (integer_type_node), + size, + TREE_UNSIGNED (integer_type_node)), + TYPE_MODE (integer_type_node)); #endif - /* Immediately move the result of the libcall into a pseudo - register so reload doesn't clobber the value if it needs - the return register for a spill reg. */ - result = gen_reg_rtx (TYPE_MODE (integer_type_node)); result_mode = TYPE_MODE (integer_type_node); - emit_move_insn (result, - hard_libcall_value (result_mode)); } *px = result; *py = const0_rtx; @@ -3483,14 +3477,8 @@ prepare_cmp_insn (px, py, pcomparison, size, pmode, punsignedp, purpose) if (unsignedp && ucmp_optab->handlers[(int) mode].libfunc) libfunc = ucmp_optab->handlers[(int) mode].libfunc; - emit_library_call (libfunc, LCT_CONST_MAKE_BLOCK, word_mode, 2, x, mode, - y, mode); - - /* Immediately move the result of the libcall into a pseudo - register so reload doesn't clobber the value if it needs - the return register for a spill reg. */ - result = gen_reg_rtx (word_mode); - emit_move_insn (result, hard_libcall_value (word_mode)); + result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST_MAKE_BLOCK, + word_mode, 2, x, mode, y, mode); /* Integer comparison returns a result that must be compared against 1, so that even if we do an unsigned compare afterward, @@ -4006,9 +3994,8 @@ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp) if (libfunc == 0) abort (); - result = gen_reg_rtx (word_mode); - emit_library_call_value (libfunc, result, LCT_CONST_MAKE_BLOCK, - word_mode, 2, x, mode, y, mode); + result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST_MAKE_BLOCK, + word_mode, 2, x, mode, y, mode); *px = result; *py = const0_rtx; *pmode = word_mode;