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: [Committed] S/390: Don't ICE in print_operand and print_operand_address


> These should be using output_operand_lossage, which generates an an error
> if these are triggered from an asm, and an ICE otherwise.

Ok. I've committed the following patch. Thanks!

Bye,

-Andreas-

2010-11-29  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* config/s390/s390.c (print_operand_address): Replace 'error' with
	'output_operand_lossage'.
	(print_operand): Likewise.

Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig
--- gcc/config/s390/s390.c
*************** print_operand_address (FILE *file, rtx a
*** 5132,5138 ****
      {
        if (!TARGET_Z10)
  	{
! 	  error ("symbolic memory references are only supported on z10 or later");
  	  return;
  	}
        output_addr_const (file, addr);
--- 5132,5139 ----
      {
        if (!TARGET_Z10)
  	{
! 	  output_operand_lossage ("symbolic memory references are "
! 				  "only supported on z10 or later");
  	  return;
  	}
        output_addr_const (file, addr);
*************** print_operand (FILE *file, rtx x, int co
*** 5201,5207 ****
        else if (GET_CODE (x) == GT)
  	fprintf (file, "h");
        else
! 	error ("invalid comparison operator for 'E' output modifier");
        return;
  
      case 'J':
--- 5202,5209 ----
        else if (GET_CODE (x) == GT)
  	fprintf (file, "h");
        else
! 	output_operand_lossage ("invalid comparison operator "
! 				"for 'E' output modifier");
        return;
  
      case 'J':
*************** print_operand (FILE *file, rtx x, int co
*** 5221,5227 ****
  	  assemble_name (file, get_some_local_dynamic_name ());
  	}
        else
! 	error ("invalid reference for 'J' output modifier");
        return;
  
      case 'G':
--- 5223,5229 ----
  	  assemble_name (file, get_some_local_dynamic_name ());
  	}
        else
! 	output_operand_lossage ("invalid reference for 'J' output modifier");
        return;
  
      case 'G':
*************** print_operand (FILE *file, rtx x, int co
*** 5235,5241 ****
  
  	if (!MEM_P (x))
  	  {
! 	    error ("memory reference expected for 'O' output modifier");
  	    return;
  	  }
  
--- 5237,5244 ----
  
  	if (!MEM_P (x))
  	  {
! 	    output_operand_lossage ("memory reference expected for "
! 				    "'O' output modifier");
  	    return;
  	  }
  
*************** print_operand (FILE *file, rtx x, int co
*** 5245,5251 ****
  	    || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base)))
  	    || ad.indx)
  	  {
! 	    error ("invalid address for 'O' output modifier");
  	    return;
  	  }
  
--- 5248,5254 ----
  	    || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base)))
  	    || ad.indx)
  	  {
! 	    output_operand_lossage ("invalid address for 'O' output modifier");
  	    return;
  	  }
  
*************** print_operand (FILE *file, rtx x, int co
*** 5263,5269 ****
  
  	if (!MEM_P (x))
  	  {
! 	    error ("memory reference expected for 'R' output modifier");
  	    return;
  	  }
  
--- 5266,5273 ----
  
  	if (!MEM_P (x))
  	  {
! 	    output_operand_lossage ("memory reference expected for "
! 				    "'R' output modifier");
  	    return;
  	  }
  
*************** print_operand (FILE *file, rtx x, int co
*** 5273,5279 ****
  	    || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base)))
  	    || ad.indx)
  	  {
! 	    error ("invalid address for 'R' output modifier");
  	    return;
  	  }
  
--- 5277,5283 ----
  	    || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base)))
  	    || ad.indx)
  	  {
! 	    output_operand_lossage ("invalid address for 'R' output modifier");
  	    return;
  	  }
  
*************** print_operand (FILE *file, rtx x, int co
*** 5291,5297 ****
  
  	if (!MEM_P (x))
  	  {
! 	    error ("memory reference expected for 'S' output modifier");
  	    return;
  	  }
  	ret = s390_decompose_address (XEXP (x, 0), &ad);
--- 5295,5302 ----
  
  	if (!MEM_P (x))
  	  {
! 	    output_operand_lossage ("memory reference expected for "
! 				    "'S' output modifier");
  	    return;
  	  }
  	ret = s390_decompose_address (XEXP (x, 0), &ad);
*************** print_operand (FILE *file, rtx x, int co
*** 5300,5306 ****
  	    || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base)))
  	    || ad.indx)
  	  {
! 	    error ("invalid address for 'S' output modifier");
  	    return;
  	  }
  
--- 5305,5311 ----
  	    || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base)))
  	    || ad.indx)
  	  {
! 	    output_operand_lossage ("invalid address for 'S' output modifier");
  	    return;
  	  }
  
*************** print_operand (FILE *file, rtx x, int co
*** 5320,5326 ****
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4));
        else
! 	error ("register or memory expression expected for 'N' output modifier");
        break;
  
      case 'M':
--- 5325,5332 ----
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4));
        else
! 	output_operand_lossage ("register or memory expression expected "
! 				"for 'N' output modifier");
        break;
  
      case 'M':
*************** print_operand (FILE *file, rtx x, int co
*** 5329,5335 ****
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8));
        else
! 	error ("register or memory expression expected for 'M' output modifier");
        break;
  
      case 'Y':
--- 5335,5342 ----
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8));
        else
! 	output_operand_lossage ("register or memory expression expected "
! 				"for 'M' output modifier");
        break;
  
      case 'Y':
*************** print_operand (FILE *file, rtx x, int co
*** 5388,5408 ****
        else if (code == 'x')
          fprintf (file, HOST_WIDE_INT_PRINT_DEC, CONST_DOUBLE_LOW (x) & 0xffff);
        else if (code == 'h')
!         fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((CONST_DOUBLE_LOW (x) & 0xffff) ^ 0x8000) - 0x8000);
        else
  	{
  	  if (code == 0)
! 	    error ("invalid constant - try using an output modifier");
  	  else
! 	    error ("invalid constant for output modifier '%c'", code);
  	}
        break;
  
      default:
        if (code == 0)
! 	error ("invalid expression - try using an output modifier");
        else
! 	error ("invalid expression for output modifier '%c'", code);
        break;
      }
  }
--- 5395,5420 ----
        else if (code == 'x')
          fprintf (file, HOST_WIDE_INT_PRINT_DEC, CONST_DOUBLE_LOW (x) & 0xffff);
        else if (code == 'h')
!         fprintf (file, HOST_WIDE_INT_PRINT_DEC,
! 		 ((CONST_DOUBLE_LOW (x) & 0xffff) ^ 0x8000) - 0x8000);
        else
  	{
  	  if (code == 0)
! 	    output_operand_lossage ("invalid constant - try using "
! 				    "an output modifier");
  	  else
! 	    output_operand_lossage ("invalid constant for output modifier '%c'",
! 				    code);
  	}
        break;
  
      default:
        if (code == 0)
! 	output_operand_lossage ("invalid expression - try using "
! 				"an output modifier");
        else
! 	output_operand_lossage ("invalid expression for output "
! 				"modifier '%c'", code);
        break;
      }
  }


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