在 2023/4/4 下午4:40, Xi Ruoyao 写道:
On Tue, 2023-04-04 at 16:00 +0800, Xi Ruoyao via Gcc-patches wrote:
On Tue, 2023-04-04 at 11:01 +0800, Lulu Cheng wrote:
/* snip */
+unsigned long f10 (unsigned long x) { return x - 0x80000000l * 2; }
+unsigned long f11 (unsigned long x) { return x - 0x80000000l * 2; }
These two test cases are duplicates.
/* snip */
+unsigned int g10 (unsigned int x) { return x - 0x80000000l * 2; }
+unsigned int g11 (unsigned int x) { return x - 0x80000000l * 2; }
Ditto.
I'll fix them in V2.
I found that adding this log test case gcc.target/loongarch/stack-check-cfa-1.c
and gcc.target/loongarch/stack-check-cfa-2.c test failed.
Although the test fails, the generated assembly code is better, and there is no
problem with the logic of the assembly code. I haven't checked the reason for
this yet.
Looks like the change hides PR109035 (like -fpie) for some reason. (But
I still don't understand the root cause of PR109035 anyway.)
V2 sent with test cases fixed.
/* snip */
Technically there should be "addu16i.d $r3,$r3,-1" in the prologue and
"addu16i.d $r3,$r3,2" in the epilogue, so we can avoid using r14/r13.
I'll try modifying loongarch_expand_{pro,epi}logue for this.
Will do this later because I'm too stupid to understand
loongarch_first_stack_step function quickly :).
Thank you very much!