This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] SPARC -fstack-protector support
On Wed, Jul 06, 2005 at 03:43:31PM -0700, Richard Henderson wrote:
> On Tue, Jul 05, 2005 at 08:47:44AM -0400, Jakub Jelinek wrote:
> > +(define_insn "stack_protect_testsi"
> > + [(set (reg:CC 100)
> > + (unspec:CC [(match_operand:SI 0 "memory_operand" "m")
> > + (match_operand:SI 1 "memory_operand" "m")]
> > + UNSPEC_SP_TEST))
> > + (clobber (match_scratch:SI 2 "=&r"))
> > + (set (match_scratch:SI 3 "=r") (const_int 0))]
>
> Canonically, clobbers go at the end.
ppc has the same issue, fixed thusly, tested with make check
and make check with -fstack-protect and installed as obvious.
2005-07-07 Jakub Jelinek <jakub@redhat.com>
* config/sparc/sparc.md (stack_protect_testsi): Put clobbers after
all sets in the pattern.
* config/rs6000/rs6000.md (stack_protect_testsi,
stack_protect_testdi): Likewise.
--- gcc/config/rs6000/rs6000.md.jj 2005-07-02 10:19:06.000000000 +0200
+++ gcc/config/rs6000/rs6000.md 2005-07-07 10:20:06.000000000 +0200
@@ -10818,8 +10818,8 @@
(unspec:CCEQ [(match_operand:SI 1 "memory_operand" "m,m")
(match_operand:SI 2 "memory_operand" "m,m")]
UNSPEC_SP_TEST))
- (clobber (match_scratch:SI 3 "=&r,&r"))
- (set (match_scratch:SI 4 "=r,r") (const_int 0))]
+ (set (match_scratch:SI 4 "=r,r") (const_int 0))
+ (clobber (match_scratch:SI 3 "=&r,&r"))]
"TARGET_32BIT"
"@
{l%U1%X1|lwz%U1%X1} %3,%1\;{l%U2%X2|lwz%U2%X2} %4,%2\;xor. %3,%3,%4\;{lil|li} %4,0
@@ -10831,8 +10831,8 @@
(unspec:CCEQ [(match_operand:DI 1 "memory_operand" "m,m")
(match_operand:DI 2 "memory_operand" "m,m")]
UNSPEC_SP_TEST))
- (clobber (match_scratch:DI 3 "=&r,&r"))
- (set (match_scratch:DI 4 "=r,r") (const_int 0))]
+ (set (match_scratch:DI 4 "=r,r") (const_int 0))
+ (clobber (match_scratch:DI 3 "=&r,&r"))]
"TARGET_64BIT"
"@
ld%U1%X1 %3,%1\;ld%U2%X2 %4,%2\;xor. %3,%3,%4\;{lil|li} %4,0
--- gcc/config/sparc/sparc.md.jj 2005-07-05 14:26:14.000000000 +0200
+++ gcc/config/sparc/sparc.md 2005-07-07 10:18:04.000000000 +0200
@@ -8229,8 +8229,8 @@
(unspec:CC [(match_operand:SI 0 "memory_operand" "m")
(match_operand:SI 1 "memory_operand" "m")]
UNSPEC_SP_TEST))
- (clobber (match_scratch:SI 2 "=&r"))
- (set (match_scratch:SI 3 "=r") (const_int 0))]
+ (set (match_scratch:SI 3 "=r") (const_int 0))
+ (clobber (match_scratch:SI 2 "=&r"))]
"TARGET_ARCH32"
"ld\t%0, %2\;ld\t%1, %3\;xorcc\t%2, %3, %2\;mov\t0, %3"
[(set_attr "type" "multi")
Jakub