From bec03e1caff2af585501092f1a27640464dc98db Mon Sep 17 00:00:00 2001 From: uros Date: Wed, 24 Jan 2007 11:17:09 +0000 Subject: [PATCH] * config/i386/i386.md (tanxf2, tan2, atan2, log2, log102, log22, expxf2, exp10xf2, exp2xf2): Use op2 instead of operands[2] to avoid access past the end of array. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121106 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.md | 50 ++++++++++++++++++++++++------------------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1946e83e7e..1afc85d1a6c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-01-24 Uros Bizjak + + * config/i386/i386.md (tanxf2, tan2, atan2, log2, + log102, log22, expxf2, exp10xf2, exp2xf2): Use op2 + instead of operands[2] to avoid access past the end of array. + 2007-01-24 Richard Sandiford * reload1.c (emit_reload_insns): Pass the reload register diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 5ca723b4501..56cf81d0bc3 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -15904,9 +15904,9 @@ && flag_unsafe_math_optimizations" { rtx one = gen_reg_rtx (XFmode); - operands[2] = CONST1_RTX (XFmode); /* fld1 */ + rtx op2 = CONST1_RTX (XFmode); /* fld1 */ - emit_insn (gen_fptanxf4_i387 (one, operands[0], operands[1], operands[2])); + emit_insn (gen_fptanxf4_i387 (one, operands[0], operands[1], op2)); DONE; }) @@ -15921,10 +15921,10 @@ rtx op0 = gen_reg_rtx (XFmode); rtx one = gen_reg_rtx (mode); - operands[2] = CONST1_RTX (mode); /* fld1 */ + rtx op2 = CONST1_RTX (mode); /* fld1 */ emit_insn (gen_fptan_extendxf4_i387 (one, op0, - operands[1], operands[2])); + operands[1], op2)); emit_insn (gen_truncxf2_i387_noop (operands[0], op0)); DONE; }) @@ -16006,10 +16006,10 @@ { rtx op0 = gen_reg_rtx (XFmode); - operands[2] = gen_reg_rtx (mode); - emit_move_insn (operands[2], CONST1_RTX (mode)); /* fld1 */ + rtx op2 = gen_reg_rtx (mode); + emit_move_insn (op2, CONST1_RTX (mode)); /* fld1 */ - emit_insn (gen_fpatan_extendxf3_i387 (op0, operands[2], operands[1])); + emit_insn (gen_fpatan_extendxf3_i387 (op0, op2, operands[1])); emit_insn (gen_truncxf2_i387_noop (operands[0], op0)); DONE; }) @@ -16139,10 +16139,10 @@ { rtx op0 = gen_reg_rtx (XFmode); - operands[2] = gen_reg_rtx (XFmode); - emit_move_insn (operands[2], standard_80387_constant_rtx (4)); /* fldln2 */ + rtx op2 = gen_reg_rtx (XFmode); + emit_move_insn (op2, standard_80387_constant_rtx (4)); /* fldln2 */ - emit_insn (gen_fyl2x_extendxf3_i387 (op0, operands[1], operands[2])); + emit_insn (gen_fyl2x_extendxf3_i387 (op0, operands[1], op2)); emit_insn (gen_truncxf2_i387_noop (operands[0], op0)); DONE; }) @@ -16169,10 +16169,10 @@ { rtx op0 = gen_reg_rtx (XFmode); - operands[2] = gen_reg_rtx (XFmode); - emit_move_insn (operands[2], standard_80387_constant_rtx (3)); /* fldlg2 */ + rtx op2 = gen_reg_rtx (XFmode); + emit_move_insn (op2, standard_80387_constant_rtx (3)); /* fldlg2 */ - emit_insn (gen_fyl2x_extendxf3_i387 (op0, operands[1], operands[2])); + emit_insn (gen_fyl2x_extendxf3_i387 (op0, operands[1], op2)); emit_insn (gen_truncxf2_i387_noop (operands[0], op0)); DONE; }) @@ -16199,10 +16199,10 @@ { rtx op0 = gen_reg_rtx (XFmode); - operands[2] = gen_reg_rtx (XFmode); - emit_move_insn (operands[2], CONST1_RTX (XFmode)); /* fld1 */ + rtx op2 = gen_reg_rtx (XFmode); + emit_move_insn (op2, CONST1_RTX (XFmode)); /* fld1 */ - emit_insn (gen_fyl2x_extendxf3_i387 (op0, operands[1], operands[2])); + emit_insn (gen_fyl2x_extendxf3_i387 (op0, operands[1], op2)); emit_insn (gen_truncxf2_i387_noop (operands[0], op0)); DONE; }) @@ -16387,10 +16387,10 @@ "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations && !optimize_size" { - operands[2] = gen_reg_rtx (XFmode); - emit_move_insn (operands[2], standard_80387_constant_rtx (5)); /* fldl2e */ + rtx op2 = gen_reg_rtx (XFmode); + emit_move_insn (op2, standard_80387_constant_rtx (5)); /* fldl2e */ - emit_insn (gen_expNcorexf3 (operands[0], operands[1], operands[2])); + emit_insn (gen_expNcorexf3 (operands[0], operands[1], op2)); DONE; }) @@ -16417,10 +16417,10 @@ "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations && !optimize_size" { - operands[2] = gen_reg_rtx (XFmode); - emit_move_insn (operands[2], standard_80387_constant_rtx (6)); /* fldl2t */ + rtx op2 = gen_reg_rtx (XFmode); + emit_move_insn (op2, standard_80387_constant_rtx (6)); /* fldl2t */ - emit_insn (gen_expNcorexf3 (operands[0], operands[1], operands[2])); + emit_insn (gen_expNcorexf3 (operands[0], operands[1], op2)); DONE; }) @@ -16447,10 +16447,10 @@ "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations && !optimize_size" { - operands[2] = gen_reg_rtx (XFmode); - emit_move_insn (operands[2], CONST1_RTX (XFmode)); /* fld1 */ + rtx op2 = gen_reg_rtx (XFmode); + emit_move_insn (op2, CONST1_RTX (XFmode)); /* fld1 */ - emit_insn (gen_expNcorexf3 (operands[0], operands[1], operands[2])); + emit_insn (gen_expNcorexf3 (operands[0], operands[1], op2)); DONE; }) -- 2.11.4.GIT