X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fexplow.c;h=1f66f3e770538fae8f716223adaec3548f1474b5;hb=1577e1c17a0e33424963d1dee28d9f819522eab6;hp=a887849816b1e468cd2c9925b43bf083285fe88b;hpb=53226a3c702920e140da494dcd5798f9fc9809f0;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/explow.c b/gcc/explow.c index a887849816b..1f66f3e7705 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -43,7 +43,6 @@ along with GCC; see the file COPYING3. If not see static rtx break_out_memory_refs (rtx); static void emit_stack_probe (rtx); -static void anti_adjust_stack_and_probe (rtx); /* Truncate and perhaps sign-extend C as appropriate for MODE. */ @@ -1308,7 +1307,7 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align) } if (flag_stack_check && STACK_CHECK_MOVING_SP) - anti_adjust_stack_and_probe (size); + anti_adjust_stack_and_probe (size, false); else anti_adjust_stack (size); @@ -1367,9 +1366,6 @@ emit_stack_probe (rtx address) emit_insn (gen_probe_stack (memref)); else #endif - if (STACK_CHECK_PROBE_LOAD) - emit_move_insn (gen_reg_rtx (word_mode), memref); - else emit_move_insn (memref, const0_rtx); } @@ -1545,13 +1541,17 @@ probe_stack_range (HOST_WIDE_INT first, rtx size) } } -/* Adjust the stack by SIZE bytes while probing it. Note that we skip the - probe for the first interval + a small dope of 4 words and instead probe - that many bytes past the specified size to maintain a protection area. */ +/* Adjust the stack pointer by minus SIZE (an rtx for a number of bytes) + while probing it. This pushes when SIZE is positive. SIZE need not + be constant. If ADJUST_BACK is true, adjust back the stack pointer + by plus SIZE at the end. */ -static void -anti_adjust_stack_and_probe (rtx size) +void +anti_adjust_stack_and_probe (rtx size, bool adjust_back) { + /* We skip the probe for the first interval + a small dope of 4 words and + probe that many bytes past the specified size to maintain a protection + area at the botton of the stack. */ const int dope = 4 * UNITS_PER_WORD; /* First ensure SIZE is Pmode. */ @@ -1660,8 +1660,11 @@ anti_adjust_stack_and_probe (rtx size) } } - /* Adjust back to account for the additional first interval. */ - adjust_stack (GEN_INT (PROBE_INTERVAL + dope)); + /* Adjust back and account for the additional first interval. */ + if (adjust_back) + adjust_stack (plus_constant (size, PROBE_INTERVAL + dope)); + else + adjust_stack (GEN_INT (PROBE_INTERVAL + dope)); } /* Return an rtx representing the register or memory location