diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2005-08-21 20:07:43 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-08-21 20:07:43 -0700 |
commit | 85199961c5884ea82b3757c5671c44562861c55b (patch) | |
tree | d865870607be485dab97dbc468367b0e7cca36a8 /gcc/config/ia64/ia64.md | |
parent | 46fa431d519149579d399fc323c68fbc8b085e5f (diff) | |
download | gcc-85199961c5884ea82b3757c5671c44562861c55b.zip gcc-85199961c5884ea82b3757c5671c44562861c55b.tar.gz gcc-85199961c5884ea82b3757c5671c44562861c55b.tar.bz2 |
re PR target/23485 ([ia64]: Integer dvide by zero doesn't raise a signal)
PR target/23485
* config/ia64/ia64.md (divsi3): Check divide by zero.
(udivsi3): Likewise.
(divdi3): Likewise.
(udivdi3): Likewise.
From-SVN: r103331
Diffstat (limited to 'gcc/config/ia64/ia64.md')
-rw-r--r-- | gcc/config/ia64/ia64.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 3f43e48..ab54609 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -1896,6 +1896,9 @@ twon34 = gen_reg_rtx (XFmode); emit_insn (gen_setf_exp_xf (twon34, twon34_exp)); + emit_insn (gen_cond_trap (EQ, operands[2], CONST0_RTX (SImode), + CONST1_RTX (SImode))); + emit_insn (gen_divsi3_internal (op0_xf, op1_xf, op2_xf, twon34)); emit_insn (gen_fix_truncxfdi2_alts (op0_di, op0_xf, const1_rtx)); @@ -1953,6 +1956,9 @@ twon34 = gen_reg_rtx (XFmode); emit_insn (gen_setf_exp_xf (twon34, twon34_exp)); + emit_insn (gen_cond_trap (EQ, operands[2], CONST0_RTX (SImode), + CONST1_RTX (SImode))); + emit_insn (gen_divsi3_internal (op0_xf, op1_xf, op2_xf, twon34)); emit_insn (gen_fixuns_truncxfdi2_alts (op0_di, op0_xf, const1_rtx)); @@ -2311,6 +2317,9 @@ op2_xf = gen_reg_rtx (XFmode); expand_float (op2_xf, operands[2], 0); + emit_insn (gen_cond_trap (EQ, operands[2], CONST0_RTX (DImode), + CONST1_RTX (DImode))); + if (TARGET_INLINE_INT_DIV == INL_MIN_LAT) emit_insn (gen_divdi3_internal_lat (op0_xf, op1_xf, op2_xf)); else @@ -2357,6 +2366,9 @@ op2_xf = gen_reg_rtx (XFmode); expand_float (op2_xf, operands[2], 1); + emit_insn (gen_cond_trap (EQ, operands[2], CONST0_RTX (DImode), + CONST1_RTX (DImode))); + if (TARGET_INLINE_INT_DIV == INL_MIN_LAT) emit_insn (gen_divdi3_internal_lat (op0_xf, op1_xf, op2_xf)); else |