aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/cris
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2012-05-29 01:52:16 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2012-05-29 01:52:16 +0000
commit64f5af47c50af743fb0a58d5b074ee17d1101b22 (patch)
tree6ce9e351e597449ed071c69bd35e2445dd0f9f3c /gcc/config/cris
parent3d383eb787203c8a40865c8b18533da419f239f4 (diff)
downloadgcc-64f5af47c50af743fb0a58d5b074ee17d1101b22.zip
gcc-64f5af47c50af743fb0a58d5b074ee17d1101b22.tar.gz
gcc-64f5af47c50af743fb0a58d5b074ee17d1101b22.tar.bz2
cris.h (TARGET_HAS_BREAK, [...]): New macros.
* config/cris/cris.h (TARGET_HAS_BREAK, TARGET_TRAP_USING_BREAK8): New macros. * config/cris/cris.md ("trap"): Define, enabled for TARGET_TRAP_USING_BREAK8. * config/cris/cris.opt (mtrap-using-break8): New option. From-SVN: r187942
Diffstat (limited to 'gcc/config/cris')
-rw-r--r--gcc/config/cris/cris.h5
-rw-r--r--gcc/config/cris/cris.md8
-rw-r--r--gcc/config/cris/cris.opt4
3 files changed, 17 insertions, 0 deletions
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index ff0be00..edb5f97 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -302,9 +302,14 @@ extern int cris_cpu_version;
#define TARGET_HAS_MUL_INSNS (cris_cpu_version >= CRIS_CPU_NG)
#define TARGET_HAS_LZ (cris_cpu_version >= CRIS_CPU_ETRAX4)
+#define TARGET_HAS_BREAK (cris_cpu_version >= CRIS_CPU_ETRAX4)
#define TARGET_HAS_SWAP (cris_cpu_version >= CRIS_CPU_SVINTO)
#define TARGET_V32 (cris_cpu_version >= CRIS_CPU_V32)
+/* The "break" instruction was introduced with ETRAX 4. */
+#define TARGET_TRAP_USING_BREAK8 \
+ (cris_trap_using_break8 == 2 ? TARGET_HAS_BREAK : cris_trap_using_break8)
+
/* Node: Storage Layout */
#define BITS_BIG_ENDIAN 0
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index b4ead76..49f36e3 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -3825,6 +3825,14 @@
""
"nop"
[(set_attr "cc" "none")])
+
+;; Same as the gdb trap breakpoint, will cause a SIGTRAP for
+;; cris-linux* and crisv32-linux*, as intended. Will work in
+;; freestanding environments with sufficient framework.
+(define_insn "trap"
+ [(trap_if (const_int 1) (const_int 8))]
+ "TARGET_TRAP_USING_BREAK8"
+ "break 8")
;; We need to stop accesses to the stack after the memory is
;; deallocated. Unfortunately, reorg doesn't look at naked clobbers,
diff --git a/gcc/config/cris/cris.opt b/gcc/config/cris/cris.opt
index dc4ab57..3c2e338 100644
--- a/gcc/config/cris/cris.opt
+++ b/gcc/config/cris/cris.opt
@@ -175,6 +175,10 @@ Target Report RejectNegative Joined Var(cris_max_stackframe_str)
max-stackframe=
Target Report RejectNegative Joined Undocumented Var(cris_max_stackframe_str)
+mtrap-using-break8
+Target Report Var(cris_trap_using_break8) Init(2)
+Emit traps as \"break 8\", default for CRIS v3 and up. If disabled, calls to abort() are used.
+
; TARGET_SVINTO: Currently this just affects alignment. FIXME:
; Redundant with TARGET_ALIGN_BY_32, or put machine stuff here?
; This and the others below could just as well be variables and