aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJohn Carr <jfc@mit.edu>1998-06-17 16:14:09 +0000
committerJohn Carr <jfc@gcc.gnu.org>1998-06-17 16:14:09 +0000
commite0cd077072ade89c9aee0cabc8be0c5a6ebb23cf (patch)
treebc08309af18e3e3b81d9dde6d23a1abd41673ffe /gcc/expr.c
parent4fdf79cb6764f8c57b4c4deaabd6131850535263 (diff)
downloadgcc-e0cd077072ade89c9aee0cabc8be0c5a6ebb23cf.zip
gcc-e0cd077072ade89c9aee0cabc8be0c5a6ebb23cf.tar.gz
gcc-e0cd077072ade89c9aee0cabc8be0c5a6ebb23cf.tar.bz2
haifa-sched.c (haifa_classify_insn): TRAP_IF is risky.
* haifa-sched.c (haifa_classify_insn): TRAP_IF is risky. (sched_analyze_2): Allow scheduling TRAP_IF. * reorg.c (mark_referenced_resources): Examine operands of TRAP_IF. * rtl.h (TRAP_CODE): New macro. * rtl.def (TRAP_IF): Change second operand type to rtx. * optabs.c (gen_cond_trap): New function. (init_traps): New function. (init_optabs): Call init_traps. * expr.h: Declare gen_cond_trap. * jump.c (jump_optimize): Optimize jumps to and around traps. * sparc.md: Define trap instructions. * rs6000.md: Define trap instructions. * rs6000.c (print_operand): New code 'V' for trap condition. (trap_comparison_operator): New function. * m88k.md: Update use of TRAP_IF. * tree.h (enum built_in_function): New function code BUILT_IN_TRAP. * c-decl.c (init_decl_processing): New builtin __builtin_trap. * expr.c (expand_builtin): Handle BUILT_IN_TRAP. * expr.c (expand_builtin): Error if __builtin_longjmp second argument is not 1. From-SVN: r20543
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index aad427d..aff3dd1 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8973,10 +8973,27 @@ expand_builtin (exp, target, subtarget, mode, ignore)
VOIDmode, 0);
rtx value = expand_expr (TREE_VALUE (TREE_CHAIN (arglist)),
NULL_RTX, VOIDmode, 0);
+
+ if (value != const1_rtx)
+ {
+ error ("__builtin_longjmp second argument must be 1");
+ return const0_rtx;
+ }
+
expand_builtin_longjmp (buf_addr, value);
return const0_rtx;
}
+ case BUILT_IN_TRAP:
+#ifdef HAVE_trap
+ if (HAVE_trap)
+ emit_insn (gen_trap ());
+ else
+#endif
+ error ("__builtin_trap not supported by this target");
+ emit_barrier ();
+ return const0_rtx;
+
/* Various hooks for the DWARF 2 __throw routine. */
case BUILT_IN_UNWIND_INIT:
expand_builtin_unwind_init ();