------- Comment #2 from jh at suse dot cz  2008-08-08 10:47 -------
Subject: Re:  internal compiler error: in emit_unop_insn, at optabs.c:3806

Hi,
this is patch I am testing.

Index: optabs.c
===================================================================
*** optabs.c    (revision 138862)
--- optabs.c    (working copy)
*************** maybe_emit_unop_insn (int icode, rtx tar
*** 3769,3774 ****
--- 3769,3775 ----
    rtx temp;
    enum machine_mode mode0 = insn_data[icode].operand[1].mode;
    rtx pat;
+   rtx last = get_last_insn ();

    temp = target;

*************** maybe_emit_unop_insn (int icode, rtx tar
*** 3782,3788 ****

    pat = GEN_FCN (icode) (temp, op0);
    if (!pat)
!     return false;

    if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX && code != UNKNOWN)
      add_equal_note (pat, temp, code, op0, NULL_RTX);
--- 3783,3792 ----

    pat = GEN_FCN (icode) (temp, op0);
    if (!pat)
!     {
!       delete_insns_since (last);
!       return false;
!     }

    if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX && code != UNKNOWN)
      add_equal_note (pat, temp, code, op0, NULL_RTX);
*************** expand_fix (rtx to, rtx from, int unsign
*** 5157,5162 ****
--- 5161,5167 ----

        if (icode != CODE_FOR_nothing)
          {
+           rtx last = get_last_insn ();
            if (fmode != GET_MODE (from))
              from = convert_to_mode (fmode, from, 0);

*************** expand_fix (rtx to, rtx from, int unsign
*** 5170,5180 ****
            if (imode != GET_MODE (to))
              target = gen_reg_rtx (imode);

!           emit_unop_insn (icode, target, from,
!                           doing_unsigned ? UNSIGNED_FIX : FIX);
!           if (target != to)
!             convert_move (to, target, unsignedp);
!           return;
          }
        }

--- 5175,5188 ----
            if (imode != GET_MODE (to))
              target = gen_reg_rtx (imode);

!           if (maybe_emit_unop_insn (icode, target, from,
!                                     doing_unsigned ? UNSIGNED_FIX : FIX))
!             {
!               if (target != to)
!                 convert_move (to, target, unsignedp);
!               return;
!             }
!           delete_insns_since (last);
          }
        }

*************** expand_sfix_optab (rtx to, rtx from, con
*** 5382,5387 ****
--- 5390,5396 ----
        icode = convert_optab_handler (tab, imode, fmode)->insn_code;
        if (icode != CODE_FOR_nothing)
          {
+           rtx last = get_last_insn ();
            if (fmode != GET_MODE (from))
              from = convert_to_mode (fmode, from, 0);

*************** expand_sfix_optab (rtx to, rtx from, con
*** 5389,5395 ****
              target = gen_reg_rtx (imode);

            if (!maybe_emit_unop_insn (icode, target, from, UNKNOWN))
!             return false;
            if (target != to)
              convert_move (to, target, 0);
            return true;
--- 5398,5407 ----
              target = gen_reg_rtx (imode);

            if (!maybe_emit_unop_insn (icode, target, from, UNKNOWN))
!             {
!               delete_insns_since (last);
!               continue;
!             }
            if (target != to)
              convert_move (to, target, 0);
            return true;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37055

Reply via email to