]> gcc.gnu.org Git - gcc.git/commitdiff
cris.h (TARGET_HAS_BREAK, [...]): New macros.
authorHans-Peter Nilsson <hp@axis.com>
Tue, 29 May 2012 01:52:16 +0000 (01:52 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Tue, 29 May 2012 01:52:16 +0000 (01:52 +0000)
* 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

gcc/ChangeLog
gcc/config/cris/cris.h
gcc/config/cris/cris.md
gcc/config/cris/cris.opt

index f5afb293197793ab92eb353e591e46f52848628f..513405ff202a60808f850bbc21df6b876f7bb44e 100644 (file)
@@ -1,3 +1,11 @@
+2012-05-29  Hans-Peter Nilsson  <hp@axis.com>
+
+       * 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.
+
 2012-05-28  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/25137
index ff0be0041f01af2c287f6c9b144afd00491b2b9f..edb5f97e18b2d290fc4d97bacaa510202d40c691 100644 (file)
@@ -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
index b4ead76f38b339b4f8c74dcafbe6dbfb8e5ddd0e..49f36e350da294ece575295b3c1280ba31526b1e 100644 (file)
   ""
   "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")
 \f
 ;; We need to stop accesses to the stack after the memory is
 ;; deallocated.  Unfortunately, reorg doesn't look at naked clobbers,
index dc4ab57f0101cd2c91b7be955649a88b8a23dd96..3c2e338ffeed0c931a74896c345ed261312391ab 100644 (file)
@@ -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
This page took 0.079953 seconds and 5 git commands to generate.