bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/19910] Unsigned arithmetic and %hi()/%low() operators


From: orlandoarias at gmail dot com
Subject: [Bug gas/19910] Unsigned arithmetic and %hi()/%low() operators
Date: Tue, 05 Apr 2016 16:04:39 +0000

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

--- Comment #2 from Orlando Arias <orlandoarias at gmail dot com> ---
(In reply to Nick Clifton from comment #1)
Greetings:

>   This happens because the assembler does not support U as a suffix for
> integer constants.

Is there any chance that support for the suffix could be added to gas? Or is
there an already existing suffix which can be used with both GCC and GAS to the
same effect? I came across this issue when porting U-Boot for the LEON3 to run
on a Xilinx KC705 board.

The LEON3's main memory is mapped to start at 0x40000000 and the KC705 board
provides 1GB of RAM. If leaving the constants as signed, computing the end of
RAM an integer overflow occurs. GCC warns of this when the constants get
expanded and non-working code is generated (U-Boot crashes on the board, have
yet to debug to find out why, likely though because of the undefined behaviour
generated by the overflow). I proceeded to add typing to the preprocessor
directives and at that point the aforementioned error came up.

>   Obviously however the error message is bogus.  So I will look into that.

This should be fine as well. I can probably make two preprocessor directives,
one to be used with the assembly sources and one to be used with the C sources.
It is less than ideal, but it could work (although I am not sure as to how GAS
would go on to handle the sum at that point).

Thank you for looking into this.

Cheers,
Orlando.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]