public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* stack check support on embedded targets
@ 2001-07-06  9:19 Joel Sherrill
  2001-08-02 10:19 ` machine description problem Olivier Garbil
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Sherrill @ 2001-07-06  9:19 UTC (permalink / raw)
  To: gcc-help

Hi,

I would like to add stack check support for RTEMS tasks/threads.  This is an
run-time environment for embedded CPUs (about a dozen now) without an
MMU.  The generic stack probe code seems to assume that an MMU will
catch an access of an invalid address.  On RTEMS, the test for stack in 
range
is portable and quite simple.  The valid stack range is in the thread 
control block.
So one can write a short portable C routine to catch the fault;

void check_sp( void *sp current_sp );
  if current_sp is NOT in range
    ERROR

Any thoughts on how to generically add support for calling a probe routine
with the current stack pointer as a single argument?  It would be
fabulous if this could be added in such a way that all targets would support
it instantly.

Thanks.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

^ permalink raw reply	[flat|nested] 2+ messages in thread

* machine description problem
  2001-07-06  9:19 stack check support on embedded targets Joel Sherrill
@ 2001-08-02 10:19 ` Olivier Garbil
  0 siblings, 0 replies; 2+ messages in thread
From: Olivier Garbil @ 2001-08-02 10:19 UTC (permalink / raw)
  To: gcc-help

  Hi,


I wrote (try to !) a gcc 2.95.2 back end for our VM architecture. It
almost works
correctly but I still have some trouble.

First I would like to know why the block <code> inside the define_expand
is executed before the <move_operand> predicates is tested ?.

I thought that the predictate should be tested first.

So I don't understand the way to reject a bad insn in <movqi/hi/si> case
(FAIL
doesn't work and the spur.md is not that obvious)

Finally, when the <move_operand> predicate is executed (and reject the
insn) gcc crash.


What did I miss ?.



(define_expand "movsi"
  [(set (match_operand:SI 0 "nonimmediate_operand"
"=r,r,r,r,r,Q,o,m,>,m,Q")
	(match_operand:SI 1 "move_operand"         "r,i,Q,o,m,r,r,r,r,i,Q"))]
  ""
  "
{
  <code>
})



Thanks for your help.


Olivier Garbil
Palmware

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-02 10:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-06  9:19 stack check support on embedded targets Joel Sherrill
2001-08-02 10:19 ` machine description problem Olivier Garbil

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).