This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[COMMIT]: Fix casts in tc-arc.c


Hi Guys,

  Here is another 64--bit host patch.  This time for the tc-arc.c file
  which was occasionally casting values to (int) when in fact a wider
  value is needed.  Tested by building binutils for the arc-elf target
  and then running all of the binutils testsuites.

Cheers
  Nick

gas/ChangeLog
2006-02-10  Nick Clifton  <nickc@redhat.com>

	* config/tc-arc.c (init_opcode_tables): Fix cast.
	(arc_extoper, md_operand): Likewise.

Index: gas/config/tc-arc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arc.c,v
retrieving revision 1.37
diff -c -3 -p -r1.37 tc-arc.c
*** gas/config/tc-arc.c	11 Oct 2005 11:16:16 -0000	1.37
--- gas/config/tc-arc.c	10 Feb 2006 12:05:38 -0000
*************** init_opcode_tables (int mach)
*** 246,252 ****
  	 output registers into the object file's symbol table.  */
        symbol_table_insert (symbol_create (arc_reg_names[i].name,
  					  reg_section,
! 					  (int) &arc_reg_names[i],
  					  &zero_address_frag));
      }
  
--- 246,252 ----
  	 output registers into the object file's symbol table.  */
        symbol_table_insert (symbol_create (arc_reg_names[i].name,
  					  reg_section,
! 					  (valueT) &arc_reg_names[i],
  					  &zero_address_frag));
      }
  
*************** arc_extoper (int opertype)
*** 550,556 ****
        if ((symbolP = symbol_find (name)))
  	{
  	  if (S_GET_SEGMENT (symbolP) == reg_section)
! 	    S_SET_VALUE (symbolP, (int) &ext_oper->operand);
  	  else
  	    {
  	      as_bad ("attempt to override symbol: %s", name);
--- 550,556 ----
        if ((symbolP = symbol_find (name)))
  	{
  	  if (S_GET_SEGMENT (symbolP) == reg_section)
! 	    S_SET_VALUE (symbolP, (valueT) &ext_oper->operand);
  	  else
  	    {
  	      as_bad ("attempt to override symbol: %s", name);
*************** arc_extoper (int opertype)
*** 564,570 ****
  	{
  	  /* If its not there, add it.  */
  	  symbol_table_insert (symbol_create (name, reg_section,
! 					      (int) &ext_oper->operand, &zero_address_frag));
  	}
      }
  
--- 564,571 ----
  	{
  	  /* If its not there, add it.  */
  	  symbol_table_insert (symbol_create (name, reg_section,
! 					      (valueT) &ext_oper->operand,
! 					      &zero_address_frag));
  	}
      }
  
*************** md_operand (expressionS *expressionP)
*** 1165,1171 ****
  	    {
  	      input_line_pointer += l + 1;
  	      expressionP->X_op = O_register;
! 	      expressionP->X_add_number = (int) &ext_oper->operand;
  	      return;
  	    }
  	  ext_oper = ext_oper->next;
--- 1166,1172 ----
  	    {
  	      input_line_pointer += l + 1;
  	      expressionP->X_op = O_register;
! 	      expressionP->X_add_number = (offsetT) &ext_oper->operand;
  	      return;
  	    }
  	  ext_oper = ext_oper->next;
*************** md_operand (expressionS *expressionP)
*** 1177,1183 ****
  	    {
  	      input_line_pointer += l + 1;
  	      expressionP->X_op = O_register;
! 	      expressionP->X_add_number = (int) &arc_reg_names[i];
  	      break;
  	    }
  	}
--- 1178,1184 ----
  	    {
  	      input_line_pointer += l + 1;
  	      expressionP->X_op = O_register;
! 	      expressionP->X_add_number = (offsetT) &arc_reg_names[i];
  	      break;
  	    }
  	}


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