[PATCH AArch64]: Add constraint letter for stack_protect_test pattern

gcc/

	* config/aarch64/aarch64.md (stack_protect_test_<mode>): Mark
	scratch register as an output to placate register renaming.

gcc/testsuite/

	* gcc.dg/ssp-3.c: New.
	* gcc.dg/ssp-4.c: Likewise.

From-SVN: r215385
This commit is contained in:
James Greenhalgh 2014-09-19 09:31:01 +00:00 committed by James Greenhalgh
parent 159d58942f
commit b4e9251d1e
5 changed files with 45 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2014-09-19 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/aarch64.md (stack_protect_test_<mode>): Mark
scratch register as written.
2014-09-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (s390_emit_epilogue): Remove bogus

View File

@ -4031,7 +4031,7 @@
(unspec:PTR [(match_operand:PTR 1 "memory_operand" "m")
(match_operand:PTR 2 "memory_operand" "m")]
UNSPEC_SP_TEST))
(clobber (match_scratch:PTR 3 "&r"))]
(clobber (match_scratch:PTR 3 "=&r"))]
""
"ldr\t%<w>3, %x1\;ldr\t%<w>0, %x2\;eor\t%<w>0, %<w>3, %<w>0"
[(set_attr "length" "12")

View File

@ -1,3 +1,8 @@
2014-09-19 James Greenhalgh <james.greenhalgh@arm.com>
* gcc.dg/ssp-3.c: New.
* gcc.dg/ssp-4.c: Likewise.
2014-09-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gcc.target/s390/dfp-conv1.c: New testcase.

View File

@ -0,0 +1,16 @@
/* { dg-do assemble } */
/* { dg-options "-fstack-protector-strong -O1 -frename-registers" } */
/* { dg-require-effective-target fstack_protector } */
extern int bar (const char *s, int *argc);
extern int baz (const char *s);
char
foo (const char *s)
{
int argc;
int ret;
if ( !bar (s, &argc))
ret = baz (s);
return *s;
}

View File

@ -0,0 +1,18 @@
/* { dg-do assemble } */
/* { dg-options "-fstack-protector-strong -O1 -frename-registers" } */
/* { dg-require-effective-target fstack_protector } */
typedef unsigned int uint32_t;
struct ctx
{
uint32_t A;
};
void *
buffer_copy (const struct ctx *ctx, void *resbuf)
{
uint32_t buffer[4];
buffer[0] = (ctx->A);
__builtin_memcpy (resbuf, buffer, sizeof (buffer));
return resbuf;
}