https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111267
Bug ID: 111267 Summary: Codegen regression from i386 argument passing changes Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: manolis.tsamis at vrull dot eu CC: roger at nextmovesoftware dot com, ubizjak at gmail dot com Target Milestone: --- Code generation for the following testcase: typedef struct { float minx, miny; float maxx, maxy; } AABB; int TestOverlap(AABB a, AABB b) { return a.minx <= b.maxx && a.miny <= b.maxy && a.maxx >= b.minx && a.maxx >= b.minx; } int TestOverlap2(AABB a, AABB b) { return a.miny <= b.maxy && a.maxx >= b.minx; } has regressed due to commit https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=bdf2737cda53a83332db1a1a021653447b05a7e7 GCC13.2: TestOverlap: comiss xmm3, xmm0 movq rdx, xmm0 movq rsi, xmm1 movq rax, xmm3 jb .L10 shr rdx, 32 shr rax, 32 movd xmm0, eax movd xmm4, edx comiss xmm0, xmm4 jb .L10 movd xmm1, esi xor eax, eax comiss xmm1, xmm2 setnb al ret .L10: xor eax, eax ret TestOverlap2: shufps xmm0, xmm0, 85 shufps xmm3, xmm3, 85 comiss xmm3, xmm0 jb .L17 xor eax, eax comiss xmm1, xmm2 setnb al ret .L17: xor eax, eax ret GCC trunk: TestOverlap: movq rax, xmm1 movq rdx, xmm2 movq rsi, xmm0 mov rdi, rax movq rax, xmm3 mov rcx, rsi xchg rdx, rax movd xmm1, edx mov rsi, rax mov rax, rdx comiss xmm1, xmm0 jb .L10 shr rcx, 32 shr rax, 32 movd xmm0, eax movd xmm4, ecx comiss xmm0, xmm4 jb .L10 movd xmm0, esi movd xmm1, edi xor eax, eax comiss xmm1, xmm0 setnb al ret .L10: xor eax, eax ret TestOverlap2: movq rdx, xmm2 movq rax, xmm3 movq rsi, xmm0 xchg rdx, rax mov rcx, rsi mov rsi, rax mov rax, rdx shr rcx, 32 shr rax, 32 movd xmm4, ecx movd xmm0, eax comiss xmm0, xmm4 jb .L17 movd xmm0, esi xor eax, eax comiss xmm1, xmm0 setnb al ret .L17: xor eax, eax ret (Can also be seen here https://godbolt.org/z/E4xrEn6KW)