Hi all, This patch implements the trap pattern for the AARCH64 back-end. I used the "brk #0" instruction as that is the breakpoint instruction that GDB uses. I looked at what other targets did when the instruction set did not have a trap instruction and found that using the breakpoint instruction was a common theme between them if there was not explicit defined undefined instruction to use.
OK? Build and tested on aarch64-elf with no regressions. Also built a full aarch64-linux-gnu toolchain including glibc. Thanks, Andrew Pinski ChangeLog: * config/aarch64/aarch64.md (trap): New pattern.
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 758be47..10b2fc5 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -453,6 +453,11 @@ [(set_attr "v8type" "misc")] ) +(define_insn "trap" + [(trap_if (const_int 1) (const_int 8))] + "" + "brk #0") + (define_expand "prologue" [(clobber (const_int 0))] ""