[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tc-v850.c:1663: possible bad if condition ?
From: |
Nicholas Clifton |
Subject: |
Re: tc-v850.c:1663: possible bad if condition ? |
Date: |
Thu, 05 Mar 2015 13:06:35 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
Hi David,
[src/gas/config/tc-v850.c:1663]: (style) Expression is always false because
'else if' condition matches previous condition at line 1655.
Thanks for reporting this bug. I have fixed it by applying the patch below.
Cheers
Nick
gas/ChangeLog
2015-03-05 Nick Clifton <address@hidden>
* config/tc-v850.c (md_parse_option): Fix code to set or clear
EF_RH850_DATA_ALIGN8 bit in ELF header, based upon the use of the
-m8byte-align and -m4byte-align command line options.
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index fc55106..dec8739 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -1653,17 +1653,19 @@ md_parse_option (int c, char *arg)
v850_target_format = "elf32-v850-rh850";
}
else if (strcmp (arg, "8byte-align") == 0)
- v850_data_8 = TRUE;
+ {
+ v850_data_8 = TRUE;
+ v850_e_flags |= EF_RH850_DATA_ALIGN8;
+ }
else if (strcmp (arg, "4byte-align") == 0)
- v850_data_8 = FALSE;
+ {
+ v850_data_8 = FALSE;
+ v850_e_flags &= ~ EF_RH850_DATA_ALIGN8;
+ }
else if (strcmp (arg, "soft-float") == 0)
soft_float = 1;
else if (strcmp (arg, "hard-float") == 0)
soft_float = 0;
- else if (strcmp (arg, "8byte-align") == 0)
- v850_e_flags |= EF_RH850_DATA_ALIGN8;
- else if (strcmp (arg, "4byte-align") == 0)
- v850_e_flags &= ~ EF_RH850_DATA_ALIGN8;
else
return 0;