Skip to content

Operand out of range generated during linker step #663

Open
@andyetched

Description

@andyetched

I have a compilation that fails to link with the following error:

./gcc_invalid_asm.bin.ltrans0.ltrans.s: Assembler messages:
./gcc_invalid_asm.bin.ltrans0.ltrans.s:157: Error: operand out of range (256 is not between -256 and 255)
make[1]: *** [/tmp/ccFzIQq5.mk:2: gcc_invalid_asm.bin.ltrans0.ltrans.o] Error 1

It appears to be the following code:

 155 .LVL14:
 156         .loc 4 63 6 view .LVU37
 157         brhs.d  r4,r3,.L6
 158         lsrl    r6,r6,32
 159         .loc 4 66 12 view .LVU38
 160         add     r4,r4,2147483647

The file this is pointing at is:

57         .file 4 "external/_main~arc64_none~arc64_gcc_toolchain_linux_x86_64/arc64-snps-elf/include/c++/14.2.0/bits/random.tcc"

It appears as if the invalid asm generated is a brhs.d with an immediate that is outside of the s9 bounds.

Toolchain used: https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/tag/arc-2024.12-release

I've attached the inputs and outputs as well an example Makefile in gcc_invalid_asm.tar.gz

Metadata

Metadata

Labels

arc64Everything related to GNU toolchain for ARCv3 and 64-bit ARC cores in particularbugcomponent: gcc

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions