public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [MIPS] Implement static stack checking
Date: Wed, 24 Oct 2012 09:30:00 -0000	[thread overview]
Message-ID: <87a9vcb4oh.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com> (raw)
In-Reply-To: <11960832.jykuUikjBz@polaris> (Eric Botcazou's message of "Wed,	24 Oct 2012 10:20:05 +0200")

Eric Botcazou <ebotcazou@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	other threads:[~2012-10-24  9:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-21 21:25 Eric Botcazou
2012-10-22 20:32 ` Richard Sandiford
2012-10-22 21:58   ` Eric Botcazou
2012-10-22 22:09     ` Richard Sandiford
2012-10-22 22:16       ` Eric Botcazou
2012-10-22 22:27         ` Richard Sandiford
2012-10-24  8:29           ` Eric Botcazou
2012-10-24  9:30             ` Richard Sandiford [this message]
2012-10-23 14:36       ` Maciej W. Rozycki
2012-10-22 22:45 ` Richard Sandiford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a9vcb4oh.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com \
    --to=rdsandiford@googlemail.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).