https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67814
Bug ID: 67814 Summary: pentium4 cmp instruction register allocation error (tree-pre?) Product: gcc Version: 5.2.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vtjnash at gmail dot com Target Milestone: --- Created attachment 36437 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36437&action=edit alloc.c compile unit containing jl_compute_field_offsets when building code with `gcc -m32 -march=pentium4 -fPIC -O1 -ftree-pre`, I observed the following register allocation (?) error when the compiler was creating what should have been a `cmp %eax,%edx` instruction (dropping any one of those flags seems to be sufficient to avoid the error): size_t alsz = LLT_ALIGN(sz, al); cc8: 8b 55 e4 mov -0x1c(%ebp),%edx ccb: 89 d0 mov %edx,%eax ccd: 83 e8 01 sub $0x1,%eax cd0: 01 d8 add %ebx,%eax cd2: 21 c8 and %ecx,%eax cd4: 89 45 e4 mov %eax,-0x1c(%ebp) if (alsz > sz) ** cd7: 39 d2 cmp %edx,%edx ** cd9: 76 04 jbe cdf <jl_compute_field_offsets+0x108> st->haspadding = 1; cdb: 80 4f 27 20 orb $0x20,0x27(%edi) The original source code can be found at https://github.com/JuliaLang/julia/blob/26b58c6138b3e8e704ba35762e79b982b4e69b33/src/alloc.c#L583-L585, the .i file is attached.