mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-24 21:11:19 +08:00
[PATCH] aarch64: Fix PR97638
Currently the testcase in the patch was failing to produce a 'bti c' at the beginning of the function. This was because in aarch64_pac_insn_p, we were wrongly returning at the first check! 2020-10-30 Sudakshina Das <sudi.das@arm.com> gcc/ChangeLog: PR target/97638 * config/aarch64/aarch64-bti-insert.c (aarch64_pac_insn_p): Update return value on INSN_P check. gcc/testsuite/ChangeLog: PR target/97638 * gcc.target/aarch64/pr97638.c: New test.a
This commit is contained in:
parent
e881774d0d
commit
ce99142c11
@ -95,7 +95,7 @@ static bool
|
||||
aarch64_pac_insn_p (rtx x)
|
||||
{
|
||||
if (!INSN_P (x))
|
||||
return x;
|
||||
return false;
|
||||
|
||||
subrtx_var_iterator::array_type array;
|
||||
FOR_EACH_SUBRTX_VAR (iter, array, PATTERN (x), ALL)
|
||||
|
17
gcc/testsuite/gcc.target/aarch64/pr97638.c
Normal file
17
gcc/testsuite/gcc.target/aarch64/pr97638.c
Normal file
@ -0,0 +1,17 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -mbranch-protection=bti" } */
|
||||
|
||||
char *foo (const char *s, const int c)
|
||||
{
|
||||
const char *p = 0;
|
||||
for (;;)
|
||||
{
|
||||
if (*s == c)
|
||||
p = s;
|
||||
if (p != 0 || *s++ == 0)
|
||||
break;
|
||||
}
|
||||
return (char *)p;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-assembler "hint\t34" } } */
|
Loading…
x
Reference in New Issue
Block a user