diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1992-08-25 23:30:34 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1992-08-25 23:30:34 -0700 |
commit | d562e42ef4aef058c337a8722f9d94da862cf019 (patch) | |
tree | 4321e9a0551f293866d0e00cec288be7f11cef67 | |
parent | 2df53c0b9bbeb950836d2a734e9bbc9478e23df0 (diff) | |
download | gcc-d562e42ef4aef058c337a8722f9d94da862cf019.zip gcc-d562e42ef4aef058c337a8722f9d94da862cf019.tar.gz gcc-d562e42ef4aef058c337a8722f9d94da862cf019.tar.bz2 |
Partially undo Mar 7 change.
Partially undo Mar 7 change. Only call
emit_library_call with no_queue == 1 for const functions.
From-SVN: r1961
-rw-r--r-- | gcc/expr.c | 31 | ||||
-rw-r--r-- | gcc/optabs.c | 4 |
2 files changed, 22 insertions, 13 deletions
@@ -1219,12 +1219,12 @@ emit_block_move (x, y, size, align) } #ifdef TARGET_MEM_FUNCTIONS - emit_library_call (memcpy_libfunc, 1, + emit_library_call (memcpy_libfunc, 0, VOIDmode, 3, XEXP (x, 0), Pmode, XEXP (y, 0), Pmode, convert_to_mode (Pmode, size, 1), Pmode); #else - emit_library_call (bcopy_libfunc, 1, + emit_library_call (bcopy_libfunc, 0, VOIDmode, 3, XEXP (y, 0), Pmode, XEXP (x, 0), Pmode, convert_to_mode (Pmode, size, 1), Pmode); @@ -1328,12 +1328,12 @@ clear_storage (object, size) if (GET_MODE (object) == BLKmode) { #ifdef TARGET_MEM_FUNCTIONS - emit_library_call (memset_libfunc, 1, + emit_library_call (memset_libfunc, 0, VOIDmode, 3, XEXP (object, 0), Pmode, const0_rtx, Pmode, GEN_INT (size), Pmode); #else - emit_library_call (bzero_libfunc, 1, + emit_library_call (bzero_libfunc, 0, VOIDmode, 2, XEXP (object, 0), Pmode, GEN_INT (size), Pmode); @@ -1696,11 +1696,11 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, to force it to pop the bcopy-arguments right away. */ NO_DEFER_POP; #ifdef TARGET_MEM_FUNCTIONS - emit_library_call (memcpy_libfunc, 1, + emit_library_call (memcpy_libfunc, 0, VOIDmode, 3, temp, Pmode, XEXP (xinner, 0), Pmode, size, Pmode); #else - emit_library_call (bcopy_libfunc, 1, + emit_library_call (bcopy_libfunc, 0, VOIDmode, 3, XEXP (xinner, 0), Pmode, temp, Pmode, size, Pmode); #endif @@ -1818,7 +1818,16 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, NO_QUEUE will be true if and only if the library call is a `const' call which will be enclosed in REG_LIBCALL/REG_RETVAL notes; it is equivalent - to the variable is_const in expand_call. */ + to the variable is_const in expand_call. + + NO_QUEUE must be true for const calls, because if it isn't, then + any pending increment will be emitted between REG_LIBCALL/REG_RETVAL notes, + and will be lost if the libcall sequence is optimized away. + + NO_QUEUE must be false for non-const calls, because if it isn't, the + call insn will have its CONST_CALL_P bit set, and it will be incorrectly + optimized. For instance, the instruction scheduler may incorrectly + move memory references across the non-const call. */ void emit_library_call (va_alist) @@ -2148,12 +2157,12 @@ expand_assignment (to, from, want_value, suggest_reg) rtx size = expr_size (from); #ifdef TARGET_MEM_FUNCTIONS - emit_library_call (memcpy_libfunc, 1, + emit_library_call (memcpy_libfunc, 0, VOIDmode, 3, XEXP (to_rtx, 0), Pmode, XEXP (from_rtx, 0), Pmode, size, Pmode); #else - emit_library_call (bcopy_libfunc, 1, + emit_library_call (bcopy_libfunc, 0, VOIDmode, 3, XEXP (from_rtx, 0), Pmode, XEXP (to_rtx, 0), Pmode, size, Pmode); @@ -2350,10 +2359,10 @@ store_expr (exp, target, suggest_reg) if (size != const0_rtx) { #ifdef TARGET_MEM_FUNCTIONS - emit_library_call (memset_libfunc, 1, VOIDmode, 3, + emit_library_call (memset_libfunc, 0, VOIDmode, 3, temp, Pmode, const0_rtx, Pmode, size, Pmode); #else - emit_library_call (bzero_libfunc, 1, VOIDmode, 2, + emit_library_call (bzero_libfunc, 0, VOIDmode, 2, temp, Pmode, size, Pmode); #endif } diff --git a/gcc/optabs.c b/gcc/optabs.c index cee0762..c99bbc7 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1708,12 +1708,12 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align) #endif { #ifdef TARGET_MEM_FUNCTIONS - emit_library_call (memcmp_libfunc, 1, + emit_library_call (memcmp_libfunc, 0, TYPE_MODE (integer_type_node), 3, XEXP (x, 0), Pmode, XEXP (y, 0), Pmode, size, Pmode); #else - emit_library_call (bcmp_libfunc, 1, + emit_library_call (bcmp_libfunc, 0, TYPE_MODE (integer_type_node), 3, XEXP (x, 0), Pmode, XEXP (y, 0), Pmode, size, Pmode); |