[v1,1/1] gas: microblaze: fixing constant range check issue

Message ID 20230926124637.683385-1-neal.frager@amd.com
State Accepted, archived
Headers
Series [v1,1/1] gas: microblaze: fixing constant range check issue |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 fail Testing failed
linaro-tcwg-bot/tcwg_binutils_check--master-arm fail Testing failed
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Testing passed

Commit Message

Neal Frager Sept. 26, 2023, 12:46 p.m. UTC
  The range check should be checking for the range
ffffffff80000000..7fffffff, not ffffffff70000000.

This patch has been tested for years of AMD Xilinx Yocto
releases as part of the following patch set:

https://github.com/Xilinx/meta-xilinx/tree/master/meta-microblaze/recipes-devtools/binutils/binutils

Signed-off-by: nagaraju <nagaraju.mekala@amd.com>
Signed-off-by: Neal Frager <neal.frager@amd.com>
---
 gas/config/tc-microblaze.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Nick Clifton Sept. 27, 2023, 3:23 p.m. UTC | #1
Hi Neal,

> The range check should be checking for the range
> ffffffff80000000..7fffffff, not ffffffff70000000.
> 
> This patch has been tested for years of AMD Xilinx Yocto
> releases as part of the following patch set:
> 
> https://github.com/Xilinx/meta-xilinx/tree/master/meta-microblaze/recipes-devtools/binutils/binutils
> 
> Signed-off-by: nagaraju <nagaraju.mekala@amd.com>
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
>   gas/config/tc-microblaze.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Approved, please apply.

Cheers
   Nick
  
Michael Eager Sept. 29, 2023, 3:48 p.m. UTC | #2
On 9/27/23 08:23, Nick Clifton via Binutils wrote:
> Hi Neal,
> 
>> The range check should be checking for the range
>> ffffffff80000000..7fffffff, not ffffffff70000000.
>>
>> This patch has been tested for years of AMD Xilinx Yocto
>> releases as part of the following patch set:
>>
>> https://github.com/Xilinx/meta-xilinx/tree/master/meta-microblaze/recipes-devtools/binutils/binutils
>>
>> Signed-off-by: nagaraju <nagaraju.mekala@amd.com>
>> Signed-off-by: Neal Frager <neal.frager@amd.com>
>> ---
>>   gas/config/tc-microblaze.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Approved, please apply.
> 
> Cheers
>    Nick
> 

Updated patch description.

Committed.
  

Patch

diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index 564e0b786e2..f205bb10b2b 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -755,7 +755,7 @@  parse_imm (char * s, expressionS * e, offsetT min, offsetT max)
       if ((e->X_add_number >> 31) == 1)
 	e->X_add_number |= -((addressT) (1U << 31));
 
-      if (e->X_add_number < min || e->X_add_number > max)
+      if ((int)e->X_add_number < min || (int)e->X_add_number > max)
 	{
 	  as_fatal (_("operand must be absolute in range %lx..%lx, not %lx"),
 		    (long) min, (long) max, (long) e->X_add_number);