https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96993
Bug ID: 96993 Summary: invalid code Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jan.smets at nokia dot com Target Milestone: --- Created attachment 49203 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49203&action=edit testcase Following testcase produces invalid code in 10.1, 10.2. Works with 9.3. %rdi is sometimes invalid in call to listReplaceEntry() (is 0x8) (or if listReplaceEntry() would always return, it would crash on mov 0x18(%rbx),%rbx right before constructing %rdi for the call (%rbx is zero on second loop iteration) Adding simple code changes, like a asm("nop") before if (b_rep), makes it produce working code. Configured with: /usr/src/gcc/configure --build=x86_64-linux-gnu --disable-multilib --enable-languages=c,c++,fortran,go Compile testcase with -O2 [-fno-omit-frame-pointer]