Allow more stwux instructions in host-darwin.c

Geoffrey Keating gkeating@apple.com
Tue Jun 7 08:23:00 GMT 2005


It turns out that alloca() operations, which of course are quite
likely to overflow the stack, copy the previous stack frame pointer,
not the current one, and so look like 'stwux r2,r1,r3' not 'stwux
r1,r1,r3'.

Bootstrapped & tested on powerpc-darwin8.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/rs6000-darwinhost-stwuxallowed.patch======
2005-06-07  Geoffrey Keating  <geoffk@apple.com>

	* config/rs6000/host-darwin.c (segv_handler): Widen the possible
	'stwux' instructions that are considered to be stack decrements.

Index: config/rs6000/host-darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/host-darwin.c,v
retrieving revision 1.15
diff -u -p -u -p -r1.15 host-darwin.c
--- config/rs6000/host-darwin.c	3 May 2005 11:48:37 -0000	1.15
+++ config/rs6000/host-darwin.c	7 Jun 2005 08:21:21 -0000
@@ -73,7 +73,7 @@ segv_handler (int sig ATTRIBUTE_UNUSED,
      this.  */
 
   if ((faulting_insn & 0xFFFF8000) == 0x94218000  /* stwu %r1, -xxx(%r1) */
-      || (faulting_insn & 0xFFFF03FF) == 0x7C21016E /* stwux %r1, xxx, %r1 */
+      || (faulting_insn & 0xFC1F03FF) == 0x7C01016E /* stwux xxx, %r1, xxx */
       || (faulting_insn & 0xFC1F8000) == 0x90018000 /* stw xxx, -yyy(%r1) */
       || (faulting_insn & 0xFC1F8000) == 0xD8018000 /* stfd xxx, -yyy(%r1) */
       || (faulting_insn & 0xFC1F8000) == 0xBC018000 /* stmw xxx, -yyy(%r1) */)
============================================================



More information about the Gcc-patches mailing list