Open witbring opened 11 months ago
@llvm/issue-subscribers-backend-mips
@FlyGoat @wzssyqa Ping.
gas complains as
nn.s: Assembler messages:
nn.s:2: Error: branch to misaligned address (0x1)
nn.s:3: Error: branch to misaligned address (0x2)
nn.s:4: Warning: no .cprestore pseudo-op used in PIC code
nn.s:6: Error: branch to misaligned address (0x5)
nn.s: Internal error (Segmentation fault).
Please report this bug.
The real problem is that the assembler for MIPS doesn't support use IMM as the target of branch. In fact gas generates bad binary also: https://sourceware.org/bugzilla/show_bug.cgi?id=31343
Thank you for replay. :) I believe that an assembler ought to generate an error message whenever encountering invalid syntax.
Yes. We have 2 choice now:
B . + 8
.Could you provide a clearer explanation? What exactly do you mean by 'Add the support of IMM'?
@wzssyqa FYI as per my reading of MIPSpro Assembly Language Programmer’s Guide
offset operand of branch instructions can only be a label (or label based expression).
However for jump intrusions it should allow arbitrary address.
Could you provide a clearer explanation? What exactly do you mean by 'Add the support of IMM'?
I guess Yunqiang means support immediate value as memory offset properly.
In that case, we should take relocation into consideration.
I separate the bug report #67787 since the report has distinct bugs
The subsequent issue was identified within Clang v16.0.0.
Operand Type Check Bug
Clang changes a memory operand as an immediate value in the case of
bc1tl
,bc1fl
,jal
,jalx
andj
instructions.