This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Commit: Score: Fix GAS compile-time warnings
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Mon, 13 Jun 2011 10:34:25 +0100
- Subject: Commit: Score: Fix GAS compile-time warnings
Hi Guys,
I am checking in the patch below to fix compile time warnings about
local variables that are set but not used when building GAS for the
Score target.
Cheers
Nick
gas/ChangeLog
2011-06-13 Nick Clifton <nickc@redhat.com>
* config/tc-score.c (s3_my_get_expression): Delete unused local
variable 'seg'.
(s3_do_ldst_insn): Delete unused local variable 'strbak'.
(s3_do16_ldst_insn): Delete unused local variable 'temp'.
(s3_do_macro_bcmp): Zero inst_expand array.
(s3_do_macro_bcmpz): Likewise.
(s3_s_score_end): Delete unused local variable 'dot'.
(s3_gen_reloc): Delete unused local variables 'f', 's', and 'e'.
* config/tc-score7.c (s7_my_get_expression): Delete unused local
variable 'seg'.
(s7_do_ldst_insn): Delete unused local variable 'strbak'.
(s7_b32_relax_to_b16): Delete unused local variables 'r_old' and
'r_new'.
(s7_s_score_end): Delete unused local variable 'dot'.
(s7_relax_frag): Delete unused local variable 'relax_size'.
(s7_gen_reloc): Delete unused local variables 'f', 's', and 'e'.
Index: gas/config/tc-score.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-score.c,v
retrieving revision 1.17
diff -c -3 -p -r1.17 tc-score.c
*** gas/config/tc-score.c 11 Dec 2009 13:42:11 -0000 1.17
--- gas/config/tc-score.c 13 Jun 2011 09:24:45 -0000
*************** static int
*** 1185,1196 ****
s3_my_get_expression (expressionS * ep, char **str)
{
char *save_in;
- segT seg;
save_in = input_line_pointer;
input_line_pointer = *str;
s3_in_my_get_expression = 1;
! seg = expression (ep);
s3_in_my_get_expression = 0;
if (ep->X_op == O_illegal)
--- 1185,1195 ----
s3_my_get_expression (expressionS * ep, char **str)
{
char *save_in;
save_in = input_line_pointer;
input_line_pointer = *str;
s3_in_my_get_expression = 1;
! (void) expression (ep);
s3_in_my_get_expression = 0;
if (ep->X_op == O_illegal)
*************** s3_do_ldst_insn (char *str)
*** 2940,2951 ****
int conflict_reg;
int value;
char * temp;
- char *strbak;
char *dataptr;
int reg;
int ldst_idx = 0;
- strbak = str;
s3_skip_whitespace (str);
if (((conflict_reg = s3_reg_required_here (&str, 20, s3_REG_TYPE_SCORE)) == (int) s3_FAIL)
--- 2939,2948 ----
*************** static void
*** 3411,3417 ****
s3_do16_ldst_insn (char *str)
{
int conflict_reg=0;
- char * temp;
s3_skip_whitespace (str);
if ((s3_reglow_required_here (&str, 8) == (int) s3_FAIL) || (s3_skip_past_comma (&str) == (int) s3_FAIL))
--- 3408,3413 ----
*************** s3_do16_ldst_insn (char *str)
*** 3433,3439 ****
}
s3_skip_whitespace (str);
! temp = str + 1; /* The latter will process decimal/hex expression. */
if (*str == ']')
{
str++;
--- 3429,3435 ----
}
s3_skip_whitespace (str);
!
if (*str == ']')
{
str++;
*************** s3_do_macro_bcmp (char *str)
*** 4499,4521 ****
struct s3_score_it inst_expand[2];
struct s3_score_it inst_main;
!
s3_skip_whitespace (str);
if (( reg_a = s3_reg_required_here (&str, 15, s3_REG_TYPE_SCORE)) == (int) s3_FAIL
|| s3_skip_past_comma (&str) == (int) s3_FAIL
||(reg_b = s3_reg_required_here (&str, 10, s3_REG_TYPE_SCORE)) == (int) s3_FAIL
|| s3_skip_past_comma (&str) == (int) s3_FAIL)
return;
! ptemp =str;
! while(*ptemp!=0)
! {
! keep_data[i]=*ptemp;
! i++;
! ptemp++;
! }
! keep_data[i]=0;
if (s3_my_get_expression (&s3_inst.reloc.exp, &str) == (int) s3_FAIL
! ||reg_b ==0
|| s3_end_of_line (str) == (int) s3_FAIL)
return ;
else if (s3_inst.reloc.exp.X_add_symbol == 0)
--- 4496,4518 ----
struct s3_score_it inst_expand[2];
struct s3_score_it inst_main;
! memset (inst_expand, 0, sizeof inst_expand);
s3_skip_whitespace (str);
if (( reg_a = s3_reg_required_here (&str, 15, s3_REG_TYPE_SCORE)) == (int) s3_FAIL
|| s3_skip_past_comma (&str) == (int) s3_FAIL
||(reg_b = s3_reg_required_here (&str, 10, s3_REG_TYPE_SCORE)) == (int) s3_FAIL
|| s3_skip_past_comma (&str) == (int) s3_FAIL)
return;
! ptemp = str;
! while (*ptemp != 0)
! {
! keep_data[i] = *ptemp;
! i++;
! ptemp++;
! }
! keep_data[i] = 0;
if (s3_my_get_expression (&s3_inst.reloc.exp, &str) == (int) s3_FAIL
! ||reg_b == 0
|| s3_end_of_line (str) == (int) s3_FAIL)
return ;
else if (s3_inst.reloc.exp.X_add_symbol == 0)
*************** s3_do_macro_bcmpz (char *str)
*** 4653,4658 ****
--- 4652,4658 ----
struct s3_score_it inst_expand[2];
struct s3_score_it inst_main;
+ memset (inst_expand, 0, sizeof inst_expand);
s3_skip_whitespace (str);
if (( reg_a = s3_reg_required_here (&str, 15, s3_REG_TYPE_SCORE)) == (int) s3_FAIL
|| s3_skip_past_comma (&str) == (int) s3_FAIL )
*************** s3_s_score_end (int x ATTRIBUTE_UNUSED)
*** 5791,5797 ****
/* Generate a .pdr section. */
segT saved_seg = now_seg;
subsegT saved_subseg = now_subseg;
- valueT dot;
expressionS exp;
char *fragp;
--- 5792,5797 ----
*************** s3_s_score_end (int x ATTRIBUTE_UNUSED)
*** 5842,5848 ****
else
{
! dot = frag_now_fix ();
gas_assert (s3_pdr_seg);
subseg_set (s3_pdr_seg, 0);
/* Write the symbol. */
--- 5842,5848 ----
else
{
! (void) frag_now_fix ();
gas_assert (s3_pdr_seg);
subseg_set (s3_pdr_seg, 0);
/* Write the symbol. */
*************** s3_gen_reloc (asection * section ATTRIBU
*** 7405,7413 ****
arelent *reloc;
bfd_reloc_code_real_type code;
char *type;
- fragS *f;
- symbolS *s;
- expressionS e;
reloc = retval[0] = xmalloc (sizeof (arelent));
retval[1] = NULL;
--- 7405,7410 ----
*************** s3_gen_reloc (asection * section ATTRIBU
*** 7446,7455 ****
*retval[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
retval[1]->address = (reloc->address + s3_RELAX_RELOC2 (fixp->fx_frag->fr_subtype));
- f = fixp->fx_frag;
- s = f->fr_symbol;
- e = s->sy_value;
-
retval[1]->addend = 0;
retval[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO16);
gas_assert (retval[1]->howto != NULL);
--- 7443,7448 ----
Index: gas/config/tc-score7.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-score7.c,v
retrieving revision 1.6
diff -c -3 -p -r1.6 tc-score7.c
*** gas/config/tc-score7.c 1 Mar 2010 16:47:52 -0000 1.6
--- gas/config/tc-score7.c 13 Jun 2011 09:24:45 -0000
*************** static int
*** 1260,1271 ****
s7_my_get_expression (expressionS * ep, char **str)
{
char *save_in;
- segT seg;
save_in = input_line_pointer;
input_line_pointer = *str;
s7_in_my_get_expression = 1;
! seg = expression (ep);
s7_in_my_get_expression = 0;
if (ep->X_op == O_illegal)
--- 1260,1271 ----
s7_my_get_expression (expressionS * ep, char **str)
{
char *save_in;
save_in = input_line_pointer;
input_line_pointer = *str;
s7_in_my_get_expression = 1;
!
! (void) expression (ep);
s7_in_my_get_expression = 0;
if (ep->X_op == O_illegal)
*************** s7_do_ldst_insn (char *str)
*** 3096,3109 ****
int conflict_reg;
int value;
char * temp;
- char *strbak;
char *dataptr;
int reg;
int ldst_idx = 0;
int hex_p = 0;
- strbak = str;
s7_skip_whitespace (str);
if (((conflict_reg = s7_reg_required_here (&str, 20, s7_REG_TYPE_SCORE)) == (int) s7_FAIL)
--- 3096,3107 ----
*************** s7_b32_relax_to_b16 (fragS * fragp)
*** 5244,5251 ****
{
int grows = 0;
int relaxable_p = 0;
- int r_old;
- int r_new;
int frag_addr = fragp->fr_address + fragp->insn_addr;
addressT symbol_address = 0;
--- 5242,5247 ----
*************** s7_b32_relax_to_b16 (fragS * fragp)
*** 5259,5266 ****
so in relax stage , it may be wrong to calculate the symbol's offset when the frag's section
is different from the symbol's. */
- r_old = s7_RELAX_OLD (fragp->fr_subtype);
- r_new = s7_RELAX_NEW (fragp->fr_subtype);
relaxable_p = s7_RELAX_OPT (fragp->fr_subtype);
s = fragp->fr_symbol;
--- 5255,5260 ----
*************** s7_s_score_end (int x ATTRIBUTE_UNUSED)
*** 5648,5654 ****
/* Generate a .pdr section. */
segT saved_seg = now_seg;
subsegT saved_subseg = now_subseg;
- valueT dot;
expressionS exp;
char *fragp;
--- 5642,5647 ----
*************** s7_s_score_end (int x ATTRIBUTE_UNUSED)
*** 5699,5705 ****
else
{
! dot = frag_now_fix ();
gas_assert (s7_pdr_seg);
subseg_set (s7_pdr_seg, 0);
/* Write the symbol. */
--- 5692,5698 ----
else
{
! (void) frag_now_fix ();
gas_assert (s7_pdr_seg);
subseg_set (s7_pdr_seg, 0);
/* Write the symbol. */
*************** s7_relax_frag (asection * sec ATTRIBUTE_
*** 6376,6382 ****
{
int grows = 0;
int insn_size;
- int insn_relax_size;
int do_relax_p = 0; /* Indicate doing relaxation for this frag. */
int relaxable_p = 0;
bfd_boolean word_align_p = FALSE;
--- 6369,6374 ----
*************** s7_relax_frag (asection * sec ATTRIBUTE_
*** 6396,6410 ****
/* Get instruction size and relax size after the last relaxation. */
if (fragp->fr_opcode)
! {
! insn_size = s7_RELAX_NEW (fragp->fr_subtype);
! insn_relax_size = s7_RELAX_OLD (fragp->fr_subtype);
! }
else
! {
! insn_size = s7_RELAX_OLD (fragp->fr_subtype);
! insn_relax_size = s7_RELAX_NEW (fragp->fr_subtype);
! }
/* Handle specially for s7_GP instruction. for, s7_judge_size_before_relax() has already determine
whether the s7_GP instruction should do relax. */
--- 6388,6396 ----
/* Get instruction size and relax size after the last relaxation. */
if (fragp->fr_opcode)
! insn_size = s7_RELAX_NEW (fragp->fr_subtype);
else
! insn_size = s7_RELAX_OLD (fragp->fr_subtype);
/* Handle specially for s7_GP instruction. for, s7_judge_size_before_relax() has already determine
whether the s7_GP instruction should do relax. */
*************** s7_gen_reloc (asection * section ATTRIBU
*** 6891,6899 ****
arelent *reloc;
bfd_reloc_code_real_type code;
char *type;
- fragS *f;
- symbolS *s;
- expressionS e;
reloc = retval[0] = xmalloc (sizeof (arelent));
retval[1] = NULL;
--- 6877,6882 ----
*************** s7_gen_reloc (asection * section ATTRIBU
*** 6932,6941 ****
*retval[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
retval[1]->address = (reloc->address + s7_RELAX_RELOC2 (fixp->fx_frag->fr_subtype));
- f = fixp->fx_frag;
- s = f->fr_symbol;
- e = s->sy_value;
-
retval[1]->addend = 0;
retval[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO16);
gas_assert (retval[1]->howto != NULL);
--- 6915,6920 ----