This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [s390] patch: updating s390.c (4/4)


Hi,

this fourth patch assertifies s390.c.
Every step bootstrapped and regtested on mainline for s390 and s390x.


2005-05-09  Adrian Straetling  <straetling@de.ibm.com>

	* config/s390/s390.c: (s390_branch_condition_mask,
	s390_branch_condition_mnemonic, s390_extra_constraint_str,
	s390_const_ok_for_constraint_p, s390_expand_plus_operand,
	legitimize_pic_address, s390_emit_tls_call_insn,
	legitimize_tls_address, legitimize_tls_address,
	s390_expand_addcc, print_shift_count_operand, print_operand,
	addr_generation_dependency_p, annotate_constant_pool_refs,
	s390_split_branches, find_constant_pool_ref,
	replace_constant_pool_ref, s390_add_constant, s390_find_constant,
	s390_find_execute, s390_mainpool_start, s390_chunkify_start,
	s390_output_pool_entry, s390_function_value,
	s390_call_saved_register_used, s390_emit_call): Replace
	conditional aborts by gcc_assert and unconditional by gcc_unreachable.
	(s390_select_ccmode, s390_match_ccmode_set, s390_extract_part,
	s390_cannot_force_const_mem, s390_output_dwarf_dtprel,
	get_some_local_dynamic_name, s390_function_arg_size,
	s390_function_arg_advance, s390_function_arg,
	s390_expand_builtin, s390_gen_rtx_const_DI): Replace abort in
	default case by gcc_unreachable.
	* config/s390/s390.md: ("*cjump_31", "*icjump_31", "*jump31"): Replace
	conditional abort by gcc_assert.
	("doloop_si31"): Replace abort in last else by gcc_unreachable.
	("main_pool", "pool"): Replace unconditional abort by gcc_unreachable.


Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig	2005-05-04 18:16:19.951486453 +0200
--- gcc/config/s390/s390.c	2005-05-04 18:16:22.031486453 +0200
*************** s390_match_ccmode_set (rtx set, enum mac
*** 264,271 ****
  {
    enum machine_mode set_mode;
  
!   if (GET_CODE (set) != SET)
!     abort ();
  
    if (GET_CODE (SET_DEST (set)) != REG || !CC_REGNO_P (REGNO (SET_DEST (set))))
      return 1;
--- 264,270 ----
  {
    enum machine_mode set_mode;
  
!   gcc_assert (GET_CODE (set) == SET);
  
    if (GET_CODE (SET_DEST (set)) != REG || !CC_REGNO_P (REGNO (SET_DEST (set))))
      return 1;
*************** s390_match_ccmode_set (rtx set, enum mac
*** 301,307 ****
        break;
  
      default:
!       abort ();
      }
  
    return (GET_MODE (SET_SRC (set)) == set_mode);
--- 300,306 ----
        break;
  
      default:
!       gcc_unreachable ();
      }
  
    return (GET_MODE (SET_SRC (set)) == set_mode);
*************** s390_select_ccmode (enum rtx_code code, 
*** 485,491 ****
  	return CCUmode;
  
        default:
! 	abort ();
      }
  }
  
--- 484,490 ----
  	return CCUmode;
  
        default:
! 	gcc_unreachable ();
      }
  }
  
*************** s390_branch_condition_mask (rtx code)
*** 639,648 ****
    const int CC2 = 1 << 1;
    const int CC3 = 1 << 0;
  
!   if (GET_CODE (XEXP (code, 0)) != REG
!       || REGNO (XEXP (code, 0)) != CC_REGNUM
!       || XEXP (code, 1) != const0_rtx)
!     abort ();
  
    switch (GET_MODE (XEXP (code, 0)))
      {
--- 638,646 ----
    const int CC2 = 1 << 1;
    const int CC3 = 1 << 0;
  
!   gcc_assert (GET_CODE (XEXP (code, 0)) == REG);
!   gcc_assert (REGNO (XEXP (code, 0)) == CC_REGNUM);
!   gcc_assert (XEXP (code, 1) == const0_rtx);
  
    switch (GET_MODE (XEXP (code, 0)))
      {
*************** s390_branch_condition_mnemonic (rtx code
*** 841,848 ****
    if (inv)
      mask ^= 15;
  
!   if (mask < 1 || mask > 14)
!     abort ();
  
    return mnemonic[mask];
  }
--- 839,845 ----
    if (inv)
      mask ^= 15;
  
!   gcc_assert (mask >= 1 && mask <= 14);
  
    return mnemonic[mask];
  }
*************** s390_extract_part (rtx op, enum machine_
*** 872,878 ****
  	return value & part_mask;
      }
  
!   abort ();
  }
  
  /* If OP is an integer constant of mode MODE with exactly one
--- 869,875 ----
  	return value & part_mask;
      }
  
!   gcc_unreachable ();
  }
  
  /* If OP is an integer constant of mode MODE with exactly one
*************** s390_extra_constraint_str (rtx op, int c
*** 1563,1570 ****
  {
    struct s390_address addr;
  
!   if (c != str[0])
!     abort ();
  
    /* Check for offsettable variants of memory constraints.  */
    if (c == 'A')
--- 1560,1566 ----
  {
    struct s390_address addr;
  
!   gcc_assert (c == str[0]);
  
    /* Check for offsettable variants of memory constraints.  */
    if (c == 'A')
*************** s390_const_ok_for_constraint_p (HOST_WID
*** 1692,1699 ****
    int def;
    int part, part_goal;
  
!   if (c != str[0])
!     abort ();
  
    switch (str[0])
      {
--- 1688,1694 ----
    int def;
    int part, part_goal;
  
!   gcc_assert (c == str[0]);
  
    switch (str[0])
      {
*************** s390_cannot_force_const_mem (rtx x)
*** 2162,2168 ****
        break;
  
      default:
!       abort ();
      }
  }
  
--- 2157,2163 ----
        break;
  
      default:
!       gcc_unreachable ();
      }
  }
  
*************** s390_expand_plus_operand (rtx target, rt
*** 2295,2302 ****
    struct s390_address ad;
  
    /* src must be a PLUS; get its two operands.  */
!   if (GET_CODE (src) != PLUS || GET_MODE (src) != Pmode)
!     abort ();
  
    /* Check if any of the two operands is already scheduled
       for replacement by reload.  This can happen e.g. when
--- 2290,2297 ----
    struct s390_address ad;
  
    /* src must be a PLUS; get its two operands.  */
!   gcc_assert (GET_CODE (src) == PLUS);
!   gcc_assert (GET_MODE (src) == Pmode);
  
    /* Check if any of the two operands is already scheduled
       for replacement by reload.  This can happen e.g. when
*************** s390_expand_plus_operand (rtx target, rt
*** 2330,2336 ****
        if (sum1 == scratch && sum2 == scratch)
  	{
  	  debug_rtx (src);
! 	  abort ();
  	}
  
        src = gen_rtx_PLUS (Pmode, sum1, sum2);
--- 2325,2331 ----
        if (sum1 == scratch && sum2 == scratch)
  	{
  	  debug_rtx (src);
! 	  gcc_unreachable ();
  	}
  
        src = gen_rtx_PLUS (Pmode, sum1, sum2);
*************** legitimize_pic_address (rtx orig, rtx re
*** 2550,2557 ****
  	  addr = XEXP (addr, 0);
  	  if (GET_CODE (addr) == UNSPEC)
  	    {
! 	      if (XVECLEN (addr, 0) != 1)
!                 abort ();
                switch (XINT (addr, 1))
                  {
                    /* If someone moved a GOT-relative UNSPEC
--- 2545,2551 ----
  	  addr = XEXP (addr, 0);
  	  if (GET_CODE (addr) == UNSPEC)
  	    {
! 	      gcc_assert (XVECLEN (addr, 0) == 1);
                switch (XINT (addr, 1))
                  {
                    /* If someone moved a GOT-relative UNSPEC
*************** legitimize_pic_address (rtx orig, rtx re
*** 2599,2609 ****
  
                    /* Everything else cannot happen.  */
                    default:
!                     abort ();
                  }
  	    }
! 	  else if (GET_CODE (addr) != PLUS)
! 	    abort ();
  	}
        if (GET_CODE (addr) == PLUS)
  	{
--- 2593,2603 ----
  
                    /* Everything else cannot happen.  */
                    default:
!                     gcc_unreachable ();
                  }
  	    }
! 	  else 
! 	    gcc_assert (GET_CODE (addr) == PLUS);
  	}
        if (GET_CODE (addr) == PLUS)
  	{
*************** legitimize_pic_address (rtx orig, rtx re
*** 2677,2684 ****
  	           && GET_CODE (op1) == CONST_INT
  	           && XINT (op0, 1) == UNSPEC_GOTOFF)
              {
! 	      if (XVECLEN (op0, 0) != 1)
!                 abort ();
  
                new = force_const_mem (Pmode, orig);
              }
--- 2671,2677 ----
  	           && GET_CODE (op1) == CONST_INT
  	           && XINT (op0, 1) == UNSPEC_GOTOFF)
              {
! 	      gcc_assert (XVECLEN (op0, 0) == 1);
  
                new = force_const_mem (Pmode, orig);
              }
*************** s390_emit_tls_call_insn (rtx result_reg,
*** 2735,2742 ****
  {
    rtx insn;
  
!   if (!flag_pic)
!     abort ();
  
    if (!s390_tls_symbol)
      s390_tls_symbol = gen_rtx_SYMBOL_REF (Pmode, "__tls_get_offset");
--- 2728,2734 ----
  {
    rtx insn;
  
!   gcc_assert (flag_pic);
  
    if (!s390_tls_symbol)
      s390_tls_symbol = gen_rtx_SYMBOL_REF (Pmode, "__tls_get_offset");
*************** legitimize_tls_address (rtx addr, rtx re
*** 2908,2914 ****
  	break;
  
        default:
! 	abort ();
        }
  
    else if (GET_CODE (addr) == CONST && GET_CODE (XEXP (addr, 0)) == UNSPEC)
--- 2900,2906 ----
  	break;
  
        default:
! 	gcc_unreachable ();
        }
  
    else if (GET_CODE (addr) == CONST && GET_CODE (XEXP (addr, 0)) == UNSPEC)
*************** legitimize_tls_address (rtx addr, rtx re
*** 2916,2929 ****
        switch (XINT (XEXP (addr, 0), 1))
  	{
  	case UNSPEC_INDNTPOFF:
! 	  if (TARGET_CPU_ZARCH)
! 	    new = addr;
! 	  else
! 	    abort ();
  	  break;
  
  	default:
! 	  abort ();
  	}
      }
  
--- 2908,2919 ----
        switch (XINT (XEXP (addr, 0), 1))
  	{
  	case UNSPEC_INDNTPOFF:
! 	  gcc_assert (TARGET_CPU_ZARCH);
! 	  new = addr;
  	  break;
  
  	default:
! 	  gcc_unreachable ();
  	}
      }
  
*************** legitimize_tls_address (rtx addr, rtx re
*** 2940,2946 ****
      }
  
    else
!     abort ();  /* for now ... */
  
    return new;
  }
--- 2930,2936 ----
      }
  
    else
!     gcc_unreachable ();  /* for now ... */
  
    return new;
  }
*************** s390_expand_addcc (enum rtx_code cmp_cod
*** 3373,3378 ****
--- 3363,3369 ----
    rtx op_res;
    rtx insn;
    rtvec p;
+   int ret;
  
    if ((GET_MODE (cmp_op0) == SImode || GET_MODE (cmp_op0) == VOIDmode)
        && (GET_MODE (cmp_op1) == SImode || GET_MODE (cmp_op1) == VOIDmode))
*************** s390_expand_addcc (enum rtx_code cmp_cod
*** 3428,3435 ****
        insn = gen_rtx_SET (VOIDmode, gen_rtx_REG (cc_mode, CC_REGNUM),
  			  gen_rtx_COMPARE (cc_mode, cmp_op0, cmp_op1));
        /* We use insn_invalid_p here to add clobbers if required.  */
!       if (insn_invalid_p (emit_insn (insn)))
! 	abort ();
  
        /* Emit ALC instruction pattern.  */
        op_res = gen_rtx_fmt_ee (cmp_code, GET_MODE (dst),
--- 3419,3426 ----
        insn = gen_rtx_SET (VOIDmode, gen_rtx_REG (cc_mode, CC_REGNUM),
  			  gen_rtx_COMPARE (cc_mode, cmp_op0, cmp_op1));
        /* We use insn_invalid_p here to add clobbers if required.  */
!       ret = insn_invalid_p (emit_insn (insn));
!       gcc_assert (!ret);
  
        /* Emit ALC instruction pattern.  */
        op_res = gen_rtx_fmt_ee (cmp_code, GET_MODE (dst),
*************** s390_expand_addcc (enum rtx_code cmp_cod
*** 3500,3507 ****
        insn = gen_rtx_SET (VOIDmode, gen_rtx_REG (cc_mode, CC_REGNUM),
  			  gen_rtx_COMPARE (cc_mode, cmp_op0, cmp_op1));
        /* We use insn_invalid_p here to add clobbers if required.  */
!       if (insn_invalid_p (emit_insn (insn)))
! 	abort ();
  
        /* Emit SLB instruction pattern.  */
        if (!register_operand (src, GET_MODE (dst)))
--- 3491,3498 ----
        insn = gen_rtx_SET (VOIDmode, gen_rtx_REG (cc_mode, CC_REGNUM),
  			  gen_rtx_COMPARE (cc_mode, cmp_op0, cmp_op1));
        /* We use insn_invalid_p here to add clobbers if required.  */
!       ret = insn_invalid_p (emit_insn (insn));
!       gcc_assert (!ret);
  
        /* Emit SLB instruction pattern.  */
        if (!register_operand (src, GET_MODE (dst)))
*************** s390_output_dwarf_dtprel (FILE *file, in
*** 3541,3547 ****
        fputs ("\t.quad\t", file);
        break;
      default:
!       abort ();
      }
    output_addr_const (file, x);
    fputs ("@DTPOFF", file);
--- 3532,3538 ----
        fputs ("\t.quad\t", file);
        break;
      default:
!       gcc_unreachable ();
      }
    output_addr_const (file, x);
    fputs ("@DTPOFF", file);
*************** print_shift_count_operand (FILE *file, r
*** 3607,3616 ****
      op = SUBREG_REG (op);
  
    /* Sanity check.  */
!   if (op && (GET_CODE (op) != REG
! 	     || REGNO (op) >= FIRST_PSEUDO_REGISTER
! 	     || REGNO_REG_CLASS (REGNO (op)) != ADDR_REGS))
!     abort ();
  
    /* Shift counts are truncated to the low six bits anyway.  */
    fprintf (file, HOST_WIDE_INT_PRINT_DEC, offset & 63);
--- 3598,3609 ----
      op = SUBREG_REG (op);
  
    /* Sanity check.  */
!   if (op)
!     {
!       gcc_assert (GET_CODE (op) == REG);
!       gcc_assert (REGNO (op) < FIRST_PSEUDO_REGISTER);
!       gcc_assert (REGNO_REG_CLASS (REGNO (op)) == ADDR_REGS);
!     }
  
    /* Shift counts are truncated to the low six bits anyway.  */
    fprintf (file, HOST_WIDE_INT_PRINT_DEC, offset & 63);
*************** get_some_local_dynamic_name (void)
*** 3657,3663 ****
          && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0))
        return cfun->machine->some_ld_name;
  
!   abort ();
  }
  
  /* Output machine-dependent UNSPECs occurring in address constant X
--- 3650,3656 ----
          && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0))
        return cfun->machine->some_ld_name;
  
!   gcc_unreachable ();
  }
  
  /* Output machine-dependent UNSPECs occurring in address constant X
*************** print_operand (FILE *file, rtx x, int co
*** 3794,3811 ****
  	  assemble_name (file, get_some_local_dynamic_name ());
  	}
        else
! 	abort ();
        return;
  
      case 'O':
        {
          struct s390_address ad;
  
!         if (GET_CODE (x) != MEM
!             || !s390_decompose_address (XEXP (x, 0), &ad)
! 	    || (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base))
!             || ad.indx)
!           abort ();
  
          if (ad.disp)
            output_addr_const (file, ad.disp);
--- 3787,3805 ----
  	  assemble_name (file, get_some_local_dynamic_name ());
  	}
        else
! 	gcc_unreachable ();
        return;
  
      case 'O':
        {
          struct s390_address ad;
+ 	int ret;
  
!         gcc_assert (GET_CODE (x) == MEM);
! 	ret = s390_decompose_address (XEXP (x, 0), &ad);
! 	gcc_assert (ret);
! 	gcc_assert (!ad.base || REG_OK_FOR_BASE_STRICT_P (ad.base));
! 	gcc_assert (!ad.indx);
  
          if (ad.disp)
            output_addr_const (file, ad.disp);
*************** print_operand (FILE *file, rtx x, int co
*** 3817,3828 ****
      case 'R':
        {
          struct s390_address ad;
  
!         if (GET_CODE (x) != MEM
!             || !s390_decompose_address (XEXP (x, 0), &ad)
! 	    || (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base))
!             || ad.indx)
!           abort ();
  
          if (ad.base)
            fprintf (file, "%s", reg_names[REGNO (ad.base)]);
--- 3811,3823 ----
      case 'R':
        {
          struct s390_address ad;
+ 	int ret;
  
!         gcc_assert (GET_CODE (x) == MEM);
! 	ret = s390_decompose_address (XEXP (x, 0), &ad);
! 	gcc_assert (ret);
! 	gcc_assert (!ad.base || REG_OK_FOR_BASE_STRICT_P (ad.base));
! 	gcc_assert (!ad.indx);
  
          if (ad.base)
            fprintf (file, "%s", reg_names[REGNO (ad.base)]);
*************** print_operand (FILE *file, rtx x, int co
*** 3834,3845 ****
      case 'S':
        {
  	struct s390_address ad;
  
! 	if (GET_CODE (x) != MEM
! 	    || !s390_decompose_address (XEXP (x, 0), &ad)
! 	    || (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base))
! 	    || ad.indx)
! 	  abort ();
  
  	if (ad.disp)
  	  output_addr_const (file, ad.disp);
--- 3829,3841 ----
      case 'S':
        {
  	struct s390_address ad;
+ 	int ret;
  
!         gcc_assert (GET_CODE (x) == MEM);
! 	ret = s390_decompose_address (XEXP (x, 0), &ad);
! 	gcc_assert (ret);
! 	gcc_assert (!ad.base || REG_OK_FOR_BASE_STRICT_P (ad.base));
! 	gcc_assert (!ad.indx);
  
  	if (ad.disp)
  	  output_addr_const (file, ad.disp);
*************** print_operand (FILE *file, rtx x, int co
*** 3857,3863 ****
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4));
        else
!         abort ();
        break;
  
      case 'M':
--- 3853,3859 ----
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4));
        else
!         gcc_unreachable ();
        break;
  
      case 'M':
*************** print_operand (FILE *file, rtx x, int co
*** 3866,3872 ****
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8));
        else
!         abort ();
        break;
  
      case 'Y':
--- 3862,3868 ----
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8));
        else
!         gcc_unreachable ();
        break;
  
      case 'Y':
*************** print_operand (FILE *file, rtx x, int co
*** 3909,3916 ****
        break;
  
      case CONST_DOUBLE:
!       if (GET_MODE (x) != VOIDmode)
!         abort ();
        if (code == 'b')
          fprintf (file, HOST_WIDE_INT_PRINT_DEC, CONST_DOUBLE_LOW (x) & 0xff);
        else if (code == 'x')
--- 3905,3911 ----
        break;
  
      case CONST_DOUBLE:
!       gcc_assert (GET_MODE (x) == VOIDmode);
        if (code == 'b')
          fprintf (file, HOST_WIDE_INT_PRINT_DEC, CONST_DOUBLE_LOW (x) & 0xff);
        else if (code == 'x')
*************** print_operand (FILE *file, rtx x, int co
*** 3918,3924 ****
        else if (code == 'h')
          fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((CONST_DOUBLE_LOW (x) & 0xffff) ^ 0x8000) - 0x8000);
        else
!         abort ();
        break;
  
      default:
--- 3913,3919 ----
        else if (code == 'h')
          fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((CONST_DOUBLE_LOW (x) & 0xffff) ^ 0x8000) - 0x8000);
        else
!         gcc_unreachable ();
        break;
  
      default:
*************** addr_generation_dependency_p (rtx dep_rt
*** 4011,4024 ****
  	      pat = PATTERN (insn);
  	      if (GET_CODE (pat) == PARALLEL)
  		{
! 		  if (XVECLEN (pat, 0) != 2)
! 		    abort();
  		  pat = XVECEXP (pat, 0, 0);
  		}
! 	      if (GET_CODE (pat) == SET)
! 		return refers_to_regno_p (regno, regno+1, SET_SRC (pat), 0);
! 	      else
! 		abort();
  	    }
  	  else if (get_attr_atype (insn) == ATYPE_AGEN)
  	    return reg_used_in_mem_p (regno, PATTERN (insn));
--- 4006,4016 ----
  	      pat = PATTERN (insn);
  	      if (GET_CODE (pat) == PARALLEL)
  		{
! 		  gcc_assert (XVECLEN (pat, 0) == 2);
  		  pat = XVECEXP (pat, 0, 0);
  		}
! 	      gcc_assert (GET_CODE (pat) == SET);
! 	      return refers_to_regno_p (regno, regno+1, SET_SRC (pat), 0);
  	    }
  	  else if (get_attr_atype (insn) == ATYPE_AGEN)
  	    return reg_used_in_mem_p (regno, PATTERN (insn));
*************** annotate_constant_pool_refs (rtx *x)
*** 4108,4116 ****
    int i, j;
    const char *fmt;
  
!   if (GET_CODE (*x) == SYMBOL_REF
!       && CONSTANT_POOL_ADDRESS_P (*x))
!     abort ();
  
    /* Literal pool references can only occur inside a MEM ...  */
    if (GET_CODE (*x) == MEM)
--- 4100,4107 ----
    int i, j;
    const char *fmt;
  
!   gcc_assert (GET_CODE (*x) != SYMBOL_REF
! 	      || !CONSTANT_POOL_ADDRESS_P (*x));
  
    /* Literal pool references can only occur inside a MEM ...  */
    if (GET_CODE (*x) == MEM)
*************** static int
*** 4210,4216 ****
  s390_split_branches (void)
  {
    rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
!   int new_literal = 0;
    rtx insn, pat, tmp, target;
    rtx *label;
  
--- 4201,4207 ----
  s390_split_branches (void)
  {
    rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
!   int new_literal = 0, ret;
    rtx insn, pat, tmp, target;
    rtx *label;
  
*************** s390_split_branches (void)
*** 4281,4288 ****
  	  target = gen_rtx_PLUS (Pmode, temp_reg, target);
  	}
  
!       if (!validate_change (insn, label, target, 0))
! 	abort ();
      }
  
    return new_literal;
--- 4272,4279 ----
  	  target = gen_rtx_PLUS (Pmode, temp_reg, target);
  	}
  
!       ret = validate_change (insn, label, target, 0);
!       gcc_assert(ret);
      }
  
    return new_literal;
*************** find_constant_pool_ref (rtx x, rtx *ref)
*** 4312,4332 ****
        && XINT (x, 1) == UNSPECV_POOL_ENTRY)
      return;
  
!   if (GET_CODE (x) == SYMBOL_REF
!       && CONSTANT_POOL_ADDRESS_P (x))
!     abort ();
  
    if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_LTREF)
      {
        rtx sym = XVECEXP (x, 0, 0);
!       if (GET_CODE (sym) != SYMBOL_REF
! 	  || !CONSTANT_POOL_ADDRESS_P (sym))
! 	abort ();
  
        if (*ref == NULL_RTX)
  	*ref = sym;
!       else if (*ref != sym)
! 	abort ();
  
        return;
      }
--- 4303,4321 ----
        && XINT (x, 1) == UNSPECV_POOL_ENTRY)
      return;
  
!   gcc_assert (GET_CODE (x) != SYMBOL_REF
!               || !CONSTANT_POOL_ADDRESS_P (x));
  
    if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_LTREF)
      {
        rtx sym = XVECEXP (x, 0, 0);
!       gcc_assert (GET_CODE (sym) == SYMBOL_REF
! 	          && CONSTANT_POOL_ADDRESS_P (sym));
  
        if (*ref == NULL_RTX)
  	*ref = sym;
!       else 
! 	gcc_assert(*ref == sym);
  
        return;
      }
*************** replace_constant_pool_ref (rtx *x, rtx r
*** 4355,4362 ****
    int i, j;
    const char *fmt;
  
!   if (*x == ref)
!     abort ();
  
    if (GET_CODE (*x) == UNSPEC
        && XINT (*x, 1) == UNSPEC_LTREF
--- 4344,4350 ----
    int i, j;
    const char *fmt;
  
!   gcc_assert (*x != ref);
  
    if (GET_CODE (*x) == UNSPEC
        && XINT (*x, 1) == UNSPEC_LTREF
*************** s390_add_constant (struct constant_pool 
*** 4581,4588 ****
    for (i = 0; i < NR_C_MODES; i++)
      if (constant_modes[i] == mode)
        break;
!   if (i == NR_C_MODES)
!     abort ();
  
    for (c = pool->constants[i]; c != NULL; c = c->next)
      if (rtx_equal_p (val, c->value))
--- 4569,4575 ----
    for (i = 0; i < NR_C_MODES; i++)
      if (constant_modes[i] == mode)
        break;
!   gcc_assert (i != NR_C_MODES);
  
    for (c = pool->constants[i]; c != NULL; c = c->next)
      if (rtx_equal_p (val, c->value))
*************** s390_find_constant (struct constant_pool
*** 4614,4628 ****
    for (i = 0; i < NR_C_MODES; i++)
      if (constant_modes[i] == mode)
        break;
!   if (i == NR_C_MODES)
!     abort ();
  
    for (c = pool->constants[i]; c != NULL; c = c->next)
      if (rtx_equal_p (val, c->value))
        break;
  
!   if (c == NULL)
!     abort ();
  
    offset = gen_rtx_MINUS (Pmode, gen_rtx_LABEL_REF (Pmode, c->label),
                                   gen_rtx_LABEL_REF (Pmode, pool->label));
--- 4601,4613 ----
    for (i = 0; i < NR_C_MODES; i++)
      if (constant_modes[i] == mode)
        break;
!   gcc_assert (i != NR_C_MODES);
  
    for (c = pool->constants[i]; c != NULL; c = c->next)
      if (rtx_equal_p (val, c->value))
        break;
  
!   gcc_assert (c);
  
    offset = gen_rtx_MINUS (Pmode, gen_rtx_LABEL_REF (Pmode, c->label),
                                   gen_rtx_LABEL_REF (Pmode, pool->label));
*************** s390_find_execute (struct constant_pool 
*** 4684,4691 ****
      if (INSN_UID (insn) == INSN_UID (c->value))
        break;
  
!   if (c == NULL)
!     abort ();
  
    offset = gen_rtx_MINUS (Pmode, gen_rtx_LABEL_REF (Pmode, c->label),
  				 gen_rtx_LABEL_REF (Pmode, pool->label));
--- 4669,4675 ----
      if (INSN_UID (insn) == INSN_UID (c->value))
        break;
  
!   gcc_assert (c);
  
    offset = gen_rtx_MINUS (Pmode, gen_rtx_LABEL_REF (Pmode, c->label),
  				 gen_rtx_LABEL_REF (Pmode, pool->label));
*************** s390_mainpool_start (void)
*** 4886,4893 ****
  	  && GET_CODE (SET_SRC (PATTERN (insn))) == UNSPEC_VOLATILE
  	  && XINT (SET_SRC (PATTERN (insn)), 1) == UNSPECV_MAIN_POOL)
  	{
! 	  if (pool->pool_insn)
! 	    abort ();
  	  pool->pool_insn = insn;
  	}
  
--- 4870,4876 ----
  	  && GET_CODE (SET_SRC (PATTERN (insn))) == UNSPEC_VOLATILE
  	  && XINT (SET_SRC (PATTERN (insn)), 1) == UNSPECV_MAIN_POOL)
  	{
! 	  gcc_assert (!pool->pool_insn);
  	  pool->pool_insn = insn;
  	}
  
*************** s390_mainpool_start (void)
*** 4908,4915 ****
  	}
      }
  
!   if (!pool->pool_insn && pool->size > 0)
!     abort ();
  
    if (pool->size >= 4096)
      {
--- 4891,4897 ----
  	}
      }
  
!   gcc_assert (pool->pool_insn || pool->size == 0);
  
    if (pool->size >= 4096)
      {
*************** s390_chunkify_start (void)
*** 5087,5096 ****
  	  rtx ltrel_base = find_ltrel_base (PATTERN (insn));
  	  if (ltrel_base)
  	    {
! 	      if (ltrel_base == pending_ltrel)
! 		pending_ltrel = NULL_RTX;
! 	      else
! 		abort ();
  	    }
  	}
  
--- 5069,5076 ----
  	  rtx ltrel_base = find_ltrel_base (PATTERN (insn));
  	  if (ltrel_base)
  	    {
! 	      gcc_assert (ltrel_base == pending_ltrel);
! 	      pending_ltrel = NULL_RTX;
  	    }
  	}
  
*************** s390_chunkify_start (void)
*** 5123,5130 ****
  		  && GET_CODE (XEXP (constant, 0)) == UNSPEC
  		  && XINT (XEXP (constant, 0), 1) == UNSPEC_LTREL_OFFSET)
  		{
! 		  if (pending_ltrel)
! 		    abort ();
  		  pending_ltrel = pool_ref;
  		}
  	    }
--- 5103,5109 ----
  		  && GET_CODE (XEXP (constant, 0)) == UNSPEC
  		  && XINT (XEXP (constant, 0), 1) == UNSPEC_LTREL_OFFSET)
  		{
! 		  gcc_assert (!pending_ltrel);
  		  pending_ltrel = pool_ref;
  		}
  	    }
*************** s390_chunkify_start (void)
*** 5135,5142 ****
  	  if (curr_pool)
  	    s390_add_pool_insn (curr_pool, insn);
  	  /* An LTREL_BASE must follow within the same basic block.  */
! 	  if (pending_ltrel)
! 	    abort ();
  	}
  
        if (!curr_pool
--- 5114,5120 ----
  	  if (curr_pool)
  	    s390_add_pool_insn (curr_pool, insn);
  	  /* An LTREL_BASE must follow within the same basic block.  */
! 	  gcc_assert (!pending_ltrel);
  	}
  
        if (!curr_pool
*************** s390_chunkify_start (void)
*** 5214,5222 ****
  
    if (curr_pool)
      s390_end_pool (curr_pool, NULL_RTX);
!   if (pending_ltrel)
!     abort ();
! 
  
    /* Find all labels that are branched into
       from an insn belonging to a different chunk.  */
--- 5192,5198 ----
  
    if (curr_pool)
      s390_end_pool (curr_pool, NULL_RTX);
!   gcc_assert (!pending_ltrel);
  
    /* Find all labels that are branched into
       from an insn belonging to a different chunk.  */
*************** s390_output_pool_entry (rtx exp, enum ma
*** 5456,5463 ****
    switch (GET_MODE_CLASS (mode))
      {
      case MODE_FLOAT:
!       if (GET_CODE (exp) != CONST_DOUBLE)
! 	abort ();
  
        REAL_VALUE_FROM_CONST_DOUBLE (r, exp);
        assemble_real (r, mode, align);
--- 5432,5438 ----
    switch (GET_MODE_CLASS (mode))
      {
      case MODE_FLOAT:
!       gcc_assert (GET_CODE (exp) == CONST_DOUBLE);
  
        REAL_VALUE_FROM_CONST_DOUBLE (r, exp);
        assemble_real (r, mode, align);
*************** s390_output_pool_entry (rtx exp, enum ma
*** 5468,5474 ****
        break;
  
      default:
!       abort ();
      }
  }
  
--- 5443,5449 ----
        break;
  
      default:
!       gcc_unreachable ();
      }
  }
  
*************** s390_function_arg_size (enum machine_mod
*** 6557,6563 ****
      return GET_MODE_SIZE (mode);
  
    /* If we have neither type nor mode, abort */
!   abort ();
  }
  
  /* Return true if a function argument of type TYPE and mode MODE
--- 6532,6538 ----
      return GET_MODE_SIZE (mode);
  
    /* If we have neither type nor mode, abort */
!   gcc_unreachable ();
  }
  
  /* Return true if a function argument of type TYPE and mode MODE
*************** s390_function_arg_advance (CUMULATIVE_AR
*** 6685,6691 ****
        cum->gprs += ((size + UNITS_PER_WORD-1) / UNITS_PER_WORD);
      }
    else
!     abort ();
  }
  
  /* Define where to put the arguments to a function.
--- 6660,6666 ----
        cum->gprs += ((size + UNITS_PER_WORD-1) / UNITS_PER_WORD);
      }
    else
!     gcc_unreachable ();
  }
  
  /* Define where to put the arguments to a function.
*************** s390_function_arg (CUMULATIVE_ARGS *cum,
*** 6737,6743 ****
    else if (type == void_type_node)
      return const0_rtx;
  
!   abort ();
  }
  
  /* Return true if return values of type TYPE should be returned
--- 6712,6718 ----
    else if (type == void_type_node)
      return const0_rtx;
  
!   gcc_unreachable ();
  }
  
  /* Return true if return values of type TYPE should be returned
*************** s390_function_value (tree type, enum mac
*** 6780,6790 ****
        mode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1);
      }
  
!   if (GET_MODE_CLASS (mode) != MODE_INT
!       && GET_MODE_CLASS (mode) != MODE_FLOAT)
!     abort ();
!   if (GET_MODE_SIZE (mode) > 8)
!     abort ();
  
    if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT)
      return gen_rtx_REG (mode, 16);
--- 6755,6763 ----
        mode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1);
      }
  
!   gcc_assert (GET_MODE_CLASS (mode) == MODE_INT
!                || GET_MODE_CLASS (mode) == MODE_FLOAT);
!   gcc_assert (GET_MODE_SIZE (mode) <= 8);
  
    if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT)
      return gen_rtx_REG (mode, 16);
*************** s390_expand_builtin (tree exp, rtx targe
*** 7219,7225 ****
        pat = GEN_FCN (icode) (target, op[0], op[1]);
        break;
      default:
!       abort ();
      }
    if (!pat)
      return NULL_RTX;
--- 7192,7198 ----
        pat = GEN_FCN (icode) (target, op[0], op[1]);
        break;
      default:
!       gcc_unreachable ();
      }
    if (!pat)
      return NULL_RTX;
*************** s390_gen_rtx_const_DI (int high, int low
*** 7293,7299 ****
  #if HOST_BITS_PER_WIDE_INT >= 32
    return immed_double_const ((HOST_WIDE_INT)low, (HOST_WIDE_INT)high, DImode);
  #else
!   abort ();
  #endif
  #endif
  }
--- 7266,7272 ----
  #if HOST_BITS_PER_WIDE_INT >= 32
    return immed_double_const ((HOST_WIDE_INT)low, (HOST_WIDE_INT)high, DImode);
  #else
!   gcc_unreachable ();
  #endif
  #endif
  }
*************** s390_call_saved_register_used (tree argu
*** 7654,7672 ****
        parameter = TREE_VALUE (argument_list);
        argument_list = TREE_CHAIN (argument_list);
  
!       if (!parameter)
! 	abort();
  
        /* For an undeclared variable passed as parameter we will get
  	 an ERROR_MARK node here.  */
        if (TREE_CODE (parameter) == ERROR_MARK)
  	return true;
  
!       if (! (type = TREE_TYPE (parameter)))
! 	abort();
  
!       if (! (mode = TYPE_MODE (TREE_TYPE (parameter))))
! 	abort();
  
        if (pass_by_reference (&cum, mode, type, true))
   	{
--- 7627,7644 ----
        parameter = TREE_VALUE (argument_list);
        argument_list = TREE_CHAIN (argument_list);
  
!       gcc_assert (parameter);
  
        /* For an undeclared variable passed as parameter we will get
  	 an ERROR_MARK node here.  */
        if (TREE_CODE (parameter) == ERROR_MARK)
  	return true;
  
!       type = TREE_TYPE (parameter);
!       gcc_assert (type);
  
!       mode = TYPE_MODE (type);
!       gcc_assert (mode);
  
        if (pass_by_reference (&cum, mode, type, true))
   	{
*************** s390_emit_call (rtx addr_location, rtx t
*** 7844,7851 ****
      {
        /* s390_function_ok_for_sibcall should
  	 have denied sibcalls in this case.  */
!       if (retaddr_reg == NULL_RTX)
! 	abort ();
  
        use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
      }
--- 7816,7822 ----
      {
        /* s390_function_ok_for_sibcall should
  	 have denied sibcalls in this case.  */
!       gcc_assert (retaddr_reg != NULL_RTX);
  
        use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
      }
Index: gcc/config/s390/s390.md
===================================================================
*** gcc/config/s390/s390.md.orig	2005-05-04 18:15:46.681486453 +0200
--- gcc/config/s390/s390.md	2005-05-04 18:16:22.041486453 +0200
***************
*** 6038,6047 ****
            (pc)))]
    "!TARGET_CPU_ZARCH"
  {
!   if (get_attr_length (insn) == 4)
!     return "j%C1\t%l0";
!   else
!     abort ();
  }
    [(set_attr "op_type" "RI")
     (set_attr "type"    "branch")
--- 6038,6045 ----
            (pc)))]
    "!TARGET_CPU_ZARCH"
  {
!   gcc_assert (get_attr_length (insn) == 4);
!   return "j%C1\t%l0";
  }
    [(set_attr "op_type" "RI")
     (set_attr "type"    "branch")
***************
*** 6103,6112 ****
            (label_ref (match_operand 0 "" ""))))]
    "!TARGET_CPU_ZARCH"
  {
!   if (get_attr_length (insn) == 4)
!     return "j%D1\t%l0";
!   else
!     abort ();
  }
    [(set_attr "op_type" "RI")
     (set_attr "type"    "branch")
--- 6101,6108 ----
            (label_ref (match_operand 0 "" ""))))]
    "!TARGET_CPU_ZARCH"
  {
!   gcc_assert (get_attr_length (insn) == 4);
!   return "j%D1\t%l0";
  }
    [(set_attr "op_type" "RI")
     (set_attr "type"    "branch")
***************
*** 6247,6253 ****
    else if (get_attr_length (insn) == 4)
      return "brct\t%1,%l0";
    else
!     abort ();
  }
    "&& reload_completed
     && (! REG_P (operands[2])
--- 6243,6249 ----
    else if (get_attr_length (insn) == 4)
      return "brct\t%1,%l0";
    else
!     gcc_unreachable ();
  }
    "&& reload_completed
     && (! REG_P (operands[2])
***************
*** 6364,6373 ****
    [(set (pc) (label_ref (match_operand 0 "" "")))]
    "!TARGET_CPU_ZARCH"
  {
!   if (get_attr_length (insn) == 4)
!     return "j\t%l0";
!   else
!     abort ();
  }
    [(set_attr "op_type" "RI")
     (set_attr "type"  "branch")
--- 6360,6367 ----
    [(set (pc) (label_ref (match_operand 0 "" "")))]
    "!TARGET_CPU_ZARCH"
  {
!   gcc_assert (get_attr_length (insn) == 4);
!   return "j\t%l0";
  }
    [(set_attr "op_type" "RI")
     (set_attr "type"  "branch")
***************
*** 6992,6998 ****
    [(set (match_operand 0 "register_operand" "=a")
          (unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))]
    "GET_MODE (operands[0]) == Pmode"
!   "* abort ();"
    [(set (attr "type") 
          (if_then_else (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
                        (const_string "larl") (const_string "la")))])
--- 6986,6994 ----
    [(set (match_operand 0 "register_operand" "=a")
          (unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))]
    "GET_MODE (operands[0]) == Pmode"
! {
!   gcc_unreachable ();
! }
    [(set (attr "type") 
          (if_then_else (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
                        (const_string "larl") (const_string "la")))])
***************
*** 7016,7022 ****
  (define_insn "pool"
    [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
    ""
!   "* abort ();"
    [(set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
  
  ;;
--- 7012,7020 ----
  (define_insn "pool"
    [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
    ""
! {
!   gcc_unreachable ();
! }
    [(set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
  
  ;;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]