OSDN Git Service

update
[pf3gnuchains/gcc-fork.git] / gcc / explow.c
index 33d6e9d..affb219 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines for manipulating rtx's in semantically interesting ways.
-   Copyright (C) 1987, 91, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1987, 91, 94-97, 1998 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.  */
 
 
 #include "config.h"
-#include <stdio.h>
+#include "system.h"
 #include "rtl.h"
 #include "tree.h"
 #include "flags.h"
@@ -867,7 +867,7 @@ emit_stack_save (save_level, psave, after)
   rtx sa = *psave;
   /* The default is that we use a move insn and save in a Pmode object.  */
   rtx (*fcn) () = gen_move_insn;
-  enum machine_mode mode = Pmode;
+  enum machine_mode mode = STACK_SAVEAREA_MODE (save_level);
 
   /* See if this machine has anything special to do for this kind of save.  */
   switch (save_level)
@@ -875,28 +875,19 @@ emit_stack_save (save_level, psave, after)
 #ifdef HAVE_save_stack_block
     case SAVE_BLOCK:
       if (HAVE_save_stack_block)
-       {
-         fcn = gen_save_stack_block;
-         mode = insn_operand_mode[CODE_FOR_save_stack_block][0];
-       }
+       fcn = gen_save_stack_block;
       break;
 #endif
 #ifdef HAVE_save_stack_function
     case SAVE_FUNCTION:
       if (HAVE_save_stack_function)
-       {
-         fcn = gen_save_stack_function;
-         mode = insn_operand_mode[CODE_FOR_save_stack_function][0];
-       }
+       fcn = gen_save_stack_function;
       break;
 #endif
 #ifdef HAVE_save_stack_nonlocal
     case SAVE_NONLOCAL:
       if (HAVE_save_stack_nonlocal)
-       {
-         fcn = gen_save_stack_nonlocal;
-         mode = insn_operand_mode[(int) CODE_FOR_save_stack_nonlocal][0];
-       }
+       fcn = gen_save_stack_nonlocal;
       break;
 #endif
     default:
@@ -975,7 +966,6 @@ emit_stack_restore (save_level, sa, after)
       break;
 #endif
 #ifdef HAVE_restore_stack_nonlocal
-
     case SAVE_NONLOCAL:
       if (HAVE_restore_stack_nonlocal)
        fcn = gen_restore_stack_nonlocal;
@@ -1034,7 +1024,7 @@ optimize_save_area_alloca (insns)
                 these precise characteristics, we did something
                 entirely wrong in allocate_dynamic_stack_space. 
 
-                Note, one way this could happen if if SETJMP_VIA_SAVE_AREA
+                Note, one way this could happen is if SETJMP_VIA_SAVE_AREA
                 was defined on a machine where stacks grow towards higher
                 addresses.
 
@@ -1243,18 +1233,15 @@ allocate_dynamic_stack_space (size, target, known_align)
 #ifdef HAVE_allocate_stack
   if (HAVE_allocate_stack)
     {
-      enum machine_mode mode;
-
       if (insn_operand_predicate[(int) CODE_FOR_allocate_stack][0]
          && ! ((*insn_operand_predicate[(int) CODE_FOR_allocate_stack][0])
                (target, Pmode)))
        target = copy_to_mode_reg (Pmode, target);
-      mode = insn_operand_mode[(int) CODE_FOR_allocate_stack][1];
-      size = convert_modes (mode, ptr_mode, size, 1);
+      size = convert_modes (Pmode, ptr_mode, size, 1);
       if (insn_operand_predicate[(int) CODE_FOR_allocate_stack][1]
          && ! ((*insn_operand_predicate[(int) CODE_FOR_allocate_stack][1])
-               (size, mode)))
-       size = copy_to_mode_reg (mode, size);
+               (size, Pmode)))
+       size = copy_to_mode_reg (Pmode, size);
 
       emit_insn (gen_allocate_stack (target, size));
     }
@@ -1366,7 +1353,8 @@ probe_stack_range (first, size)
 
   /* If we have to generate explicit probes, see if we have a constant
      small number of them to generate.  If so, that's the easy case.  */
-  if (GET_CODE (size) == CONST_INT && INTVAL (size) < 10)
+  if (GET_CODE (size) == CONST_INT
+      && INTVAL (size) < 10 * STACK_CHECK_PROBE_INTERVAL)
     {
       HOST_WIDE_INT offset;