Eric Botcazou <ebotca...@adacore.com> writes:
>> But why do we want the loop at all if the rounded size is zero?
>> It's a compile-time constant after all.
>
> Yes, this never occurs in practice because of the value set for 
> PROBE_INTERVAL 
> and STACK_CHECK_PROTECT.  This can only occur in the dynamic case handled in 
> explow.c:probe_stack_range.
>
> All the stack checking code, in the middle-end and the various back-ends, use 
> a uniform implementation.  This can probably be optimized a bit, but I'm not 
> sure it's really worth the hassle.

But wouldn't the target independent "store zero" code (e.g. for alloca)
be emitted at expand time, and optimised in the normal way?  I'd hope
jump threading etc. would then give something like the 3-insn form in
cases where the constant is known to be nonzero.  The problem here is
that we're just writing asm directly, and in that case using the 3-insn
1-branch form seems better than the 4-insn 2-branch one.  It's less
code too :-)

Richard

Reply via email to