OSDN Git Service

Partially undo Mar 7 change. Only call
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Aug 1992 06:30:34 +0000 (06:30 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Aug 1992 06:30:34 +0000 (06:30 +0000)
emit_library_call with no_queue == 1 for const functions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1961 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/expr.c
gcc/optabs.c

index e588515..7a43aca 100644 (file)
@@ -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
                }
index cee0762..c99bbc7 100644 (file)
@@ -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);