https://sourceware.org/bugzilla/show_bug.cgi?id=19910

            Bug ID: 19910
           Summary: Unsigned arithmetic and %hi()/%low() operators
           Product: binutils
           Version: 2.26
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: orlandoarias at gmail dot com
  Target Milestone: ---

Working with he sparc-leon3-linux target in gas versions 2.26.20160125
and 2.23, the following behaviour is observed:

sethi %hi(((((0x40000000U + 0x40000000U) - 160)-(8192U-160))-32U)), %fp
or %g0, %lo(((((0x40000000U +0x40000000U) - 160)-(8192U-160))-32U)), %fp

These statements fail to assemble with the error:

Error: missing ')'

However, the following assembles with no issues:

sethi %hi(((((0x40000000 + 0x40000000) - 160)-(8192-160))-32)), %fp
or %g0, %lo(((((0x40000000 +0x40000000) - 160)-(8192-160))-32)), %fp

The issue can be reduced to the following lines:

or %g0, %lo(0x40000000U +0x40000000U), %g1
or %g0, %lo((0x40000000U +0x40000000U)), %g1

The first line assembles properly, whereas the second line fails to assemble.
It looks like this is a bug with the parser. I have only tested this with the
sparc-leon3-linux target, but other targets may also be affected with the
issue. Thank you for looking into this.

Cheers,
Orlando.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to