diff options
-rw-r--r-- | gcc/ChangeLog | 31 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 549 | ||||
-rw-r--r-- | gcc/config/i386/predicates.md | 23 | ||||
-rw-r--r-- | gcc/config/i386/sse.md | 4 |
4 files changed, 300 insertions, 307 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6c76f29d007..d6dd3953ccc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,11 +1,38 @@ +2005-04-22 Nathan Sidwell <nathan@codesourcery.com> + + * config/i386/i386.md (length_immediate): Use gcc_assert or + gcc_unreachable, as appropriate. + (*movsi_1, *movqi_1, reload_outqi, *movdi_1_rex64, *pushsf, + *pushsf_rex64, *truncxfsf2_mixed, *truncxfsf2_i387, + *truncxfdf2_mixed, *truncxfdf2_i387, *adddi_1_rex64, + *adddi_2_rex64, *adddi_3_rex64, *adddi_4_rex64, *adddi_5_rex64, + *addsi_1, addsi_1_zext, *addsi_2, *addsi_2_zext, *addsi_3, + *addsi_3_zext, *addsi_4, *addsi_5, *addhi_1_lea, *addhi_1, + *addhi_2, *addhi_3, *addhi_4, *addhi_5, *addqi_1_lea, *addqi_1, + *addqi_1_slp, *addqi_2, *addqi_3, *addqi_4, *addqi_5, addqi_ext_1, + *addqi_ext_1_rex64, *anddi_1_rex64, *andsi_1, *andhi_1, + *ashldi3_1_rex64, *ashldi3_cmp_rex64, *ashlsi3_1, *ashlsi3_1_zext, + *ashlsi3_cmp, *ashlsi3_cmp_zext, *ashlhi3_1_lea, *ashlhi3_1, + *ashlhi3_cmp, *ashlqi3_1_lea, *ashlqi3_1, *ashlqi3_cmp, + pro_epilogue_adjust_stack_1, pro_epilogue_adjust_stack_rex64, + pro_epilogue_adjust_stack_rex64_2, prefetch, *prefetch_sse, + *prefetch_sse_rex): Likewise. + * config/i386/predicates.md (x86_64_immediate_operand, + x86_64_zext_immediate_operand, symbolic_operand, + no_seg_address_operand, aligned_operand, + memory_displacement_operand): Likewise. + * config/i386/sse.md (*mov<mode>_internal, + *movv2df_internal): Likewise. + 2005-04-22 Jan Hubicka <jh@suse.cz> * Makefile.in (ipa.o, ipa-inline.o): New files. * cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder, cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_default_inline_p): Declare. - * cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally, - ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns, + * cgraphunit.c (cgraph_default_inline_p, + cgraph_decide_inlining_incrementally, ncalls_inlined, + nfunctions_inlined, initial_insns, overall_insns, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_check_inline_limits, diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index f60d3d2be25..66659ae5abc 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -238,7 +238,7 @@ (const_int 1) ] (symbol_ref "/* Update immediate_length and other attributes! */ - abort(),1"))) + gcc_unreachable (),1"))) ;; The (bounding maximum) length of an instruction address. (define_attr "length_address" "" @@ -1178,8 +1178,7 @@ return "lea{l}\t{%1, %0|%0, %1}"; default: - if (flag_pic && !LEGITIMATE_PIC_OPERAND_P (operands[1])) - abort(); + gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); return "mov{l}\t{%1, %0|%0, %1}"; } } @@ -1462,8 +1461,7 @@ switch (get_attr_type (insn)) { case TYPE_IMOVX: - if (!ANY_QI_REG_P (operands[1]) && GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (ANY_QI_REG_P (operands[1]) || GET_CODE (operands[1]) == MEM); return "movz{bl|x}\t{%1, %k0|%k0, %1}"; default: if (get_attr_mode (insn) == MODE_SI) @@ -1521,8 +1519,7 @@ rtx op0, op1, op2; op0 = operands[0]; op1 = operands[1]; op2 = operands[2]; - if (reg_overlap_mentioned_p (op2, op0)) - abort (); + gcc_assert (!reg_overlap_mentioned_p (op2, op0)); if (! q_regs_operand (op1, QImode)) { emit_insn (gen_movqi (op2, op1)); @@ -1979,8 +1976,7 @@ case TYPE_LEA: return "lea{q}\t{%a1, %0|%0, %a1}"; default: - if (flag_pic && !LEGITIMATE_PIC_OPERAND_P (operands[1])) - abort (); + gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); if (get_attr_mode (insn) == MODE_SI) return "mov{l}\t{%k1, %k0|%k0, %k1}"; else if (which_alternative == 2) @@ -2121,7 +2117,7 @@ else return "movdqa\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "ssemov,ssemov,ssemov") @@ -2166,7 +2162,7 @@ else return "movdqa\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "*,*,ssemov,ssemov,ssemov") @@ -2206,15 +2202,9 @@ (match_operand:SF 1 "general_no_elim_operand" "f#rx,rFm#fx,x#rf"))] "!TARGET_64BIT" { - switch (which_alternative) - { - case 1: - return "push{l}\t%1"; - - default: - /* This insn should be already split before reg-stack. */ - abort (); - } + /* Anything else should be already split before reg-stack. */ + gcc_assert (which_alternative == 1); + return "push{l}\t%1"; } [(set_attr "type" "multi,push,multi") (set_attr "mode" "SF,SI,SF")]) @@ -2224,15 +2214,9 @@ (match_operand:SF 1 "nonmemory_no_elim_operand" "f#rx,rF#fx,x#rf"))] "TARGET_64BIT" { - switch (which_alternative) - { - case 1: - return "push{q}\t%q1"; - - default: - /* This insn should be already split before reg-stack. */ - abort (); - } + /* Anything else should be already split before reg-stack. */ + gcc_assert (which_alternative == 1); + return "push{q}\t%q1"; } [(set_attr "type" "multi,push,multi") (set_attr "mode" "SF,DI,SF")]) @@ -2314,7 +2298,7 @@ return "movq\t{%1, %0|%0, %1}"; default: - abort(); + gcc_unreachable (); } } [(set_attr "type" "fmov,fmov,fmov,imov,imov,ssemov,ssemov,ssemov,ssemov,mmxmov,mmxmov,mmxmov") @@ -2385,7 +2369,7 @@ "!TARGET_64BIT && !TARGET_INTEGER_DFMODE_MOVES" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") (set_attr "mode" "DF,SI,SI,DF")]) @@ -2396,7 +2380,7 @@ "TARGET_64BIT || TARGET_INTEGER_DFMODE_MOVES" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") (set_attr "mode" "DF,SI,DF")]) @@ -2468,7 +2452,7 @@ case MODE_TI: return "pxor\t%0, %0"; default: - abort (); + gcc_unreachable (); } case 6: case 7: @@ -2490,11 +2474,11 @@ case MODE_V2SF: return "movlps\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } default: - abort(); + gcc_unreachable (); } } [(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov") @@ -2589,7 +2573,7 @@ case MODE_TI: return "pxor\t%0, %0"; default: - abort (); + gcc_unreachable (); } case 6: case 7: @@ -2611,11 +2595,11 @@ case MODE_V2SF: return "movlps\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } default: - abort(); + gcc_unreachable(); } } [(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov") @@ -2718,7 +2702,7 @@ "optimize_size" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") (set_attr "mode" "XF,SI,SI")]) @@ -2729,7 +2713,7 @@ "!optimize_size" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") (set_attr "mode" "XF,SI")]) @@ -2788,8 +2772,9 @@ case 3: case 4: return "#"; + default: + gcc_unreachable (); } - abort(); } [(set_attr "type" "fmov,fmov,fmov,multi,multi") (set_attr "mode" "XF,XF,XF,SI,SI")]) @@ -2821,8 +2806,10 @@ case 3: case 4: return "#"; + + default: + gcc_unreachable (); } - abort(); } [(set_attr "type" "fmov,fmov,fmov,multi,multi") (set_attr "mode" "XF,XF,XF,SI,SI")]) @@ -2922,7 +2909,7 @@ else return "movdqa\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "*,*,ssemov,ssemov,ssemov") @@ -3537,7 +3524,7 @@ return "cvtss2sd\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov,fmov,ssecvt") @@ -3570,7 +3557,7 @@ return "fst%z0\t%y0"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov") @@ -3609,7 +3596,7 @@ return "fstp%z0\t%y0\n\tfld%z0\t%y0"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov") @@ -3648,7 +3635,7 @@ return "fstp%z0\t%y0"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov") @@ -3707,7 +3694,7 @@ case 2: return "cvtsd2ss\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov,fmov,ssecvt") @@ -3752,7 +3739,7 @@ case 2: return "cvtsd2ss\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov,multi,ssecvt") @@ -3775,7 +3762,7 @@ case 1: return "#"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov,multi") @@ -3837,16 +3824,11 @@ (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m"))] "TARGET_MIX_SSE_I387" { - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort(); - } + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; } [(set_attr "type" "fmov,multi,multi,multi") (set_attr "mode" "SF")]) @@ -3868,16 +3850,11 @@ (clobber (match_operand:SF 2 "memory_operand" "=X,m,m"))] "TARGET_80387" { - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort (); - } + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; } [(set_attr "type" "fmov,multi,multi") (set_attr "mode" "SF")]) @@ -3943,17 +3920,11 @@ (clobber (match_operand:DF 2 "memory_operand" "=X,m,m,m"))] "TARGET_SSE2 && TARGET_MIX_SSE_I387" { - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort(); - } - abort (); + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; } [(set_attr "type" "fmov,multi,multi,multi") (set_attr "mode" "DF")]) @@ -3975,16 +3946,11 @@ (clobber (match_operand:DF 2 "memory_operand" "=X,m,m"))] "TARGET_80387" { - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort (); - } + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; } [(set_attr "type" "fmov,multi,multi") (set_attr "mode" "DF")]) @@ -5050,18 +5016,17 @@ return "lea{q}\t{%a2, %0|%0, %a2}"; case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort (); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ @@ -5121,18 +5086,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort (); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* ???? We ought to handle there the 32bit case too - do we need new constraint? */ /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5171,18 +5135,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort (); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* ???? We ought to handle there the 32bit case too - do we need new constraint? */ /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5227,14 +5190,14 @@ case TYPE_INCDEC: if (operands[2] == constm1_rtx) return "inc{q}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{q}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if ((INTVAL (operands[2]) == -128 @@ -5270,18 +5233,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5318,18 +5280,17 @@ return "lea{l}\t{%a2, %0|%0, %a2}"; case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ @@ -5405,10 +5366,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{l}\t%k0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%k0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%k0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5470,18 +5432,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5521,10 +5482,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{l}\t%k0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%k0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%k0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5560,18 +5522,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5609,10 +5570,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{l}\t%k0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%k0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%k0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5655,14 +5617,14 @@ case TYPE_INCDEC: if (operands[2] == constm1_rtx) return "inc{l}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if ((INTVAL (operands[2]) == -128 @@ -5695,18 +5657,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5753,9 +5714,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5792,9 +5755,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5832,9 +5797,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5869,9 +5836,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5907,14 +5876,14 @@ case TYPE_INCDEC: if (operands[2] == constm1_rtx) return "inc{w}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{w}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{w}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if ((INTVAL (operands[2]) == -128 @@ -5947,9 +5916,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5996,9 +5967,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return widen ? "inc{l}\t%k0" : "inc{b}\t%0"; - else if (operands[2] == constm1_rtx) - return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6042,9 +6015,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return widen ? "inc{l}\t%k0" : "inc{b}\t%0"; - else if (operands[2] == constm1_rtx) - return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6085,9 +6060,11 @@ case TYPE_INCDEC: if (operands[1] == const1_rtx) return "inc{b}\t%0"; - else if (operands[1] == constm1_rtx) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[1] == constm1_rtx); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. */ @@ -6126,11 +6103,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */ @@ -6162,11 +6141,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */ @@ -6201,14 +6182,14 @@ || (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 255)) return "inc{b}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{b}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{b}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (INTVAL (operands[2]) < 0) { operands[2] = GEN_INT (-INTVAL (operands[2])); @@ -6239,11 +6220,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */ @@ -6281,11 +6264,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%h0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%h0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%h0"; + } default: return "add{b}\t{%2, %h0|%h0, %2}"; @@ -6315,11 +6300,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%h0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%h0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%h0"; + } default: return "add{b}\t{%2, %h0|%h0, %2}"; @@ -7341,8 +7328,7 @@ } else { - if (true_regnum (operands[1])) - abort(); + gcc_assert (!true_regnum (operands[1])); operands[4] = operands[1]; } }) @@ -7425,8 +7411,7 @@ } else { - if (true_regnum (operands[1])) - abort(); + gcc_assert (!true_regnum (operands[1])); operands[4] = operands[1]; } }) @@ -7920,14 +7905,14 @@ { enum machine_mode mode; - if (GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); if (INTVAL (operands[2]) == 0xff) mode = QImode; - else if (INTVAL (operands[2]) == 0xffff) - mode = HImode; else - abort (); + { + gcc_assert (INTVAL (operands[2]) == 0xffff); + mode = HImode; + } operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) @@ -7937,8 +7922,7 @@ } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (get_attr_mode (insn) == MODE_SI) return "and{l}\t{%k2, %k0|%k0, %k2}"; else @@ -7986,14 +7970,14 @@ { enum machine_mode mode; - if (GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); if (INTVAL (operands[2]) == 0xff) mode = QImode; - else if (INTVAL (operands[2]) == 0xffff) - mode = HImode; else - abort (); + { + gcc_assert (INTVAL (operands[2]) == 0xffff); + mode = HImode; + } operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) @@ -8003,8 +7987,7 @@ } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "and{l}\t{%2, %0|%0, %2}"; } } @@ -8106,15 +8089,12 @@ switch (get_attr_type (insn)) { case TYPE_IMOVX: - if (GET_CODE (operands[2]) != CONST_INT) - abort (); - if (INTVAL (operands[2]) == 0xff) - return "movz{bl|x}\t{%b1, %k0|%k0, %b1}"; - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); + gcc_assert (INTVAL (operands[2]) == 0xff); + return "movz{bl|x}\t{%b1, %k0|%k0, %b1}"; default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "and{w}\t{%2, %0|%0, %2}"; } @@ -10086,16 +10066,13 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); - if (!rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (operands[2] == const1_rtx); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "add{q}\t{%0, %0|%0, %0}"; case TYPE_LEA: - if (GET_CODE (operands[2]) != CONST_INT - || (unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 3) - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); + gcc_assert ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) <= 3); operands[1] = gen_rtx_MULT (DImode, operands[1], GEN_INT (1 << INTVAL (operands[2]))); return "lea{q}\t{%a1, %0|%0, %a1}"; @@ -10152,8 +10129,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{q}\t{%0, %0|%0, %0}"; default: @@ -10287,10 +10263,8 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); - if (!rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (operands[2] == const1_rtx); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "add{l}\t{%0, %0|%0, %0}"; case TYPE_LEA: @@ -10375,8 +10349,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{l}\t{%k0, %k0|%k0, %k0}"; case TYPE_LEA: @@ -10436,8 +10409,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{l}\t{%0, %0|%0, %0}"; default: @@ -10474,8 +10446,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{l}\t{%k0, %k0|%k0, %k0}"; default: @@ -10518,8 +10489,7 @@ case TYPE_LEA: return "#"; case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{w}\t{%0, %0|%0, %0}"; default: @@ -10555,8 +10525,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{w}\t{%0, %0|%0, %0}"; default: @@ -10596,8 +10565,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{w}\t{%0, %0|%0, %0}"; default: @@ -10643,8 +10611,7 @@ case TYPE_LEA: return "#"; case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1])) return "add{l}\t{%k0, %k0|%k0, %k0}"; else @@ -10698,8 +10665,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1])) return "add{l}\t{%k0, %k0|%k0, %k0}"; else @@ -10757,8 +10723,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{b}\t{%0, %0|%0, %0}"; default: @@ -18284,7 +18249,7 @@ return "lea{l}\t{%a2, %0|%0, %a2}"; default: - abort (); + gcc_unreachable (); } } [(set (attr "type") @@ -18327,7 +18292,7 @@ return "lea{q}\t{%a2, %0|%0, %a2}"; default: - abort (); + gcc_unreachable (); } } [(set (attr "type") @@ -18358,7 +18323,7 @@ return "lea{q}\t{%a2, %0|%0, %a2}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "alu,lea") @@ -19676,12 +19641,10 @@ int rw = INTVAL (operands[1]); int locality = INTVAL (operands[2]); - if (rw != 0 && rw != 1) - abort (); - if (locality < 0 || locality > 3) - abort (); - if (GET_MODE (operands[0]) != Pmode && GET_MODE (operands[0]) != VOIDmode) - abort (); + gcc_assert (rw == 0 || rw == 1); + gcc_assert (locality >= 0 && locality <= 3); + gcc_assert (GET_MODE (operands[0]) == Pmode + || GET_MODE (operands[0]) == VOIDmode); /* Use 3dNOW prefetch in case we are asking for write prefetch not supported by SSE counterpart or the SSE prefetch is not available @@ -19704,8 +19667,7 @@ }; int locality = INTVAL (operands[1]); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (locality >= 0 && locality <= 3); return patterns[locality]; } @@ -19723,8 +19685,7 @@ }; int locality = INTVAL (operands[1]); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (locality >= 0 && locality <= 3); return patterns[locality]; } diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index 668c7c061e5..0d1546808c5 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -195,7 +195,7 @@ break; default: - abort (); + gcc_unreachable (); } return 0; @@ -275,7 +275,7 @@ break; default: - abort (); + gcc_unreachable (); } return 0; }) @@ -359,7 +359,7 @@ return 0; default: - abort (); + gcc_unreachable (); } }) @@ -656,8 +656,10 @@ (match_operand 0 "address_operand") { struct ix86_address parts; - if (! ix86_decompose_address (op, &parts)) - abort (); + int ok; + + ok = ix86_decompose_address (op, &parts); + gcc_assert (ok); return parts.seg == SEG_DEFAULT; }) @@ -666,6 +668,7 @@ (match_operand 0 "general_operand") { struct ix86_address parts; + int ok; /* Registers and immediate operands are always "aligned". */ if (GET_CODE (op) != MEM) @@ -682,8 +685,8 @@ return 1; /* Decode the address. */ - if (!ix86_decompose_address (op, &parts)) - abort (); + ok = ix86_decompose_address (op, &parts); + gcc_assert (ok); /* Look for some component that isn't known to be aligned. */ if (parts.index) @@ -712,8 +715,10 @@ (match_operand 0 "memory_operand") { struct ix86_address parts; - if (!ix86_decompose_address (XEXP (op, 0), &parts)) - abort (); + int ok; + + ok = ix86_decompose_address (XEXP (op, 0), &parts); + gcc_assert (ok); return parts.disp != NULL_RTX; }) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 0f6c7eac97c..ee2e6147a15 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -75,7 +75,7 @@ else return "movdqa\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "sselog1,ssemov,ssemov") @@ -161,7 +161,7 @@ else return "movapd\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "sselog1,ssemov,ssemov") |