Code generation issue for loongarch64 compiler when using -O2 or higher optimization
Summary
Loongarch64 compiler generates faulty code when -O2
optimization option or higher is used.
System Information
- Operating system: Linux
- Processor architecture: Loongarch64
- Compiler version: 3.3.1
See failures for tcalpext.pp:
Steps to reproduce
Just compile required files for tests/test/cg/tcalpext.pp
and compile using ppcloongarch64 -O2
Example Project
What is the current bug behavior?
The code fails on function test_function_tiny_struct
.
which returns a 8-bit value.
It seems that, with -O2, the upper part of register $a0
is not zeroed out.
I do not know if this is an error in the function or in the code after
which seems to assume that upper bytes of the register are zero.