On Tue, Apr 10, 2018 at 10:45 AM, Richard Earnshaw (lists)
<[email protected]> wrote:
>>> Alpha should be fixed -- the docs clearly state that the operand is "the
>>> memory reference in the stack that needs to be probed". Just passing in
>>> the offset seems wrong.
>>
>> This pattern has to be renamed to not clash with the standard pattern name.
>>
>> I'm testing the attached patch.
>>
>
> Ugh! Two different APIs, one called gen_stack_probe and one
> gen_probe_stack? That has to be a recipe for disaster!
It is just an unforunatelly named helper expander. Maybe
"stack_probe_internal" is indeed a bettern name.
Uros.
>
> R.
>
>> Uros.
>>
>>
>> a.diff.txt
>>
>>
>> diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
>> index a039f045262c..3222cb716b63 100644
>> --- a/gcc/config/alpha/alpha.c
>> +++ b/gcc/config/alpha/alpha.c
>> @@ -7771,13 +7771,13 @@ alpha_expand_prologue (void)
>> int probed;
>>
>> for (probed = 4096; probed < probed_size; probed += 8192)
>> - emit_insn (gen_probe_stack (GEN_INT (-probed)));
>> + emit_insn (gen_stack_probe (GEN_INT (-probed)));
>>
>> /* We only have to do this probe if we aren't saving registers or
>> if we are probing beyond the frame because of -fstack-check. */
>> if ((sa_size == 0 && probed_size > probed - 4096)
>> || flag_stack_check || flag_stack_clash_protection)
>> - emit_insn (gen_probe_stack (GEN_INT (-probed_size)));
>> + emit_insn (gen_stack_probe (GEN_INT (-probed_size)));
>> }
>>
>> if (frame_size != 0)
>> diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
>> index 5d82e5a4adf7..6b99fce643b4 100644
>> --- a/gcc/config/alpha/alpha.md
>> +++ b/gcc/config/alpha/alpha.md
>> @@ -4851,7 +4851,7 @@
>>
>>
>> ;; Subroutine of stack space allocation. Perform a stack probe.
>> -(define_expand "probe_stack"
>> +(define_expand "stack_probe"
>> [(set (match_dup 1) (match_operand:DI 0 "const_int_operand"))]
>> ""
>> {
>> @@ -4886,12 +4886,12 @@
>>
>> int probed = 4096;
>>
>> - emit_insn (gen_probe_stack (GEN_INT (- probed)));
>> + emit_insn (gen_stack_probe (GEN_INT (- probed)));
>> while (probed + 8192 < INTVAL (operands[1]))
>> - emit_insn (gen_probe_stack (GEN_INT (- (probed += 8192))));
>> + emit_insn (gen_stack_probe (GEN_INT (- (probed += 8192))));
>>
>> if (probed + 4096 < INTVAL (operands[1]))
>> - emit_insn (gen_probe_stack (GEN_INT (- INTVAL(operands[1]))));
>> + emit_insn (gen_stack_probe (GEN_INT (- INTVAL(operands[1]))));
>> }
>>
>> operands[1] = GEN_INT (- INTVAL (operands[1]));
>>
>