https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117678
Bug ID: 117678
Summary: as for RISC-V generates gobbledygook with unusual but
valid label formatting
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: lightningdzeyenr at gmail dot com
Target Milestone: ---
I have a package that generates RISC-V assembly that it then passes to as to
assemble. When as from gcc 14.2.0 processes the following RISC-V assembly
addi t0, zero, 10
addi t1, zero, 10
beq t0, t1, 8
j generated_label1
fadd.s fa0, fa0, fa1
generated_label1:
fsw fa0, 0(a0)
it produces the following result (from objdump -d):
0000000000000000 <generated_label1-0x18>:
0: 00a00293 li t0,10
4: 00a00313 li t1,10
8: 00629463 bne t0,t1,10 <generated_label1-0x8>
c: 0000006f j c <generated_label1-0xc>
10: 0080006f j 18 <generated_label1>
14: 00b57553 fadd.s fa0,fa0,fa1
0000000000000018 <generated_label1>:
18: 00a52027 fsw fa0,0(a0)
When running this binary code, it gets stuck on 0000006f for no good reason,
and the beq is now a bne. This issue does not happen if the labels have
indentation like you usually see in human-written assembly. However,
indentation is not required by the RISC-V standard, so that leaves this
assembled result as a bug. llvm-mc's disassembled output is exactly the same as
the input assembly.