On 4 Dec 2013, at 16:08, "Ian Bolton" <ian.bol...@arm.com> wrote:

> Hi,
> 
> Currently, on ARM, you have to either call abort() or raise(SIGTRAP)
> to achieve a handy crash.
> 
> This patch allows you to instead call __builtin_trap() which is much
> more efficient at falling over because it becomes just a single
> instruction that will trap for you.
> 
> Two testcases have been added (for ARM and Thumb) and both pass.
> 
> 
> Note: This is a modified version of a patch originally submitted by Mark
> Mitchell back in 2010, which came in response to PR target/59091.
> 
> http://gcc.gnu.org/ml/gcc-patches/2010-09/msg00639.html
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59091
> 
> The main update, other than cosmetic differences, is that we've chosen
> the same ARM encoding as LLVM for practical purposes.  (The Thumb
> encoding in Mark's patch already matched LLVM.)
> 
> 
> OK for trunk?
> 
> Cheers,
> Ian
> 
> 
> 2013-12-04  Ian Bolton  <ian.bol...@arm.com>
>            Mark Mitchell  <m...@codesourcery.com>
> 
> gcc/
>    * config/arm/arm.md (trap): New pattern.
>    * config/arm/types.md: Added a type for trap.
> 
> testsuite/
>    * gcc.target/arm/builtin-trap.c: New test.
>    * gcc.target/arm/thumb-builtin-trap.c: Likewise.
> <aarch32-builtin-trap-v2.txt>

This needs to set the conds attribute to "unconditional".  Otherwise the ARM 
backend might try to turn this into a conditional instruction.

R.

Reply via email to