------- Comment #10 from jakub at gcc dot gnu dot org  2010-08-24 10:30 -------
It seems things go wrong during RA.  In *.asmcons we still have the correct:
...
(insn 672 304 837 3
/mnt/b1/src/linux/set64/arch/x86/include/asm/cmpxchg_32.h:96 (parallel [
            (set (reg/f:SI 558 [ value.59 ])
                (plus:SI (reg/f:SI 20 frame)
                    (const_int -20 [0xffffffffffffffec])))
            (clobber (reg:CC 17 flags))
        ]) 285 {*addsi_1} (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil)))
;; End of basic block 3 -> ( 4)
...
(insn 1253 1125 1254 79
/mnt/b1/src/linux/set64/arch/x86/include/asm/pgtable-3level.h:36 (set
(mem/c/i:SI (plus:SI (reg/f:SI 20 frame)
                (const_int -20 [0xffffffffffffffec])) [0 value+0 S4 A32])
        (reg:SI 600 [ D.29693 ])) 47 {*movsi_1} (nil))

(insn 1254 1253 673 79
/mnt/b1/src/linux/set64/arch/x86/include/asm/pgtable-3level.h:36 (set
(mem/c/i:SI (plus:SI (reg/f:SI 20 frame)
                (const_int -16 [0xfffffffffffffff0])) [0 value+4 S4 A32])
        (reg:SI 601 [ D.29693+4 ])) 47 {*movsi_1} (nil))

(note 673 1254 674 79 NOTE_INSN_DELETED)

(insn 674 673 675 79
/mnt/b1/src/linux/set64/arch/x86/include/asm/cmpxchg_32.h:72 (set (reg:SI 356)
        (mem:SI (plus:SI (reg/f:SI 558 [ value.59 ])
                (const_int 4 [0x4])) [0 S4 A32])) 47 {*movsi_1} (nil))

(insn 675 674 677 79
/mnt/b1/src/linux/set64/arch/x86/include/asm/cmpxchg_32.h:72 (parallel [
            (set (mem:DI (reg/v/f:SI 132 [ kpte ]) [0 S8 A64])
                (asm_operands/v:DI ("
1:      movl (%1), %%eax
        movl 4(%1), %%edx
        .section .smp_locks,"a"
.balign 4
.long 671f - .
.previous
671:
        lock; cmpxchg8b (%1)
        jnz 1b") ("=m") 0 [
                        (reg/v/f:SI 132 [ kpte ])
                        (reg:SI 600 [ D.29693 ])
                        (reg:SI 356)
                    ]
                     [
                        (asm_input:SI ("D") 0)
                        (asm_input:SI ("b") 0)
                        (asm_input:SI ("c") 0)
                    ] 347175))
...
i.e. it stores the correct values into the DImode stack slot and then as ebx
uses pseudo 600 and as as ecx reads from the stack the upper part (which is
equal to pseudo 601).  But in *.ira it is wrong already:
(insn 1253 1125 1254 78
/mnt/b1/src/linux/set64/arch/x86/include/asm/pgtable-3level.h:36 (set
(mem/c/i:SI (plus:SI (reg/f:SI 6 bp)
                (const_int -32 [0xffffffffffffffe0])) [0 value+0 S4 A32])
        (reg:SI 2 cx [501])) 47 {*movsi_1} (nil))

(insn 1254 1253 673 78
/mnt/b1/src/linux/set64/arch/x86/include/asm/pgtable-3level.h:36 (set
(mem/c/i:SI (plus:SI (reg/f:SI 6 bp)
                (const_int -28 [0xffffffffffffffe4])) [0 value+4 S4 A32])
        (reg:SI 3 bx [orig:601 D.29693+4 ] [601])) 47 {*movsi_1} (nil))

(note 673 1254 674 78 NOTE_INSN_DELETED)

(note 674 673 1405 78 NOTE_INSN_DELETED)

(insn 1405 674 1407 78
/mnt/b1/src/linux/set64/arch/x86/include/asm/cmpxchg_32.h:72 (set (reg:SI 5 di)
        (mem/c:SI (plus:SI (reg/f:SI 6 bp)
                (const_int -100 [0xffffffffffffff9c])) [0 %sfp+-88 S4 A32])) 47
{*movsi_1} (nil))

(insn 1407 1405 1406 78
/mnt/b1/src/linux/set64/arch/x86/include/asm/cmpxchg_32.h:72 (set (reg:SI 2 cx)
        (mem/c:SI (plus:SI (reg/f:SI 6 bp)
                (const_int -28 [0xffffffffffffffe4])) [0 S4 A32])) 47
{*movsi_1} (nil))

(insn 1406 1407 675 78
/mnt/b1/src/linux/set64/arch/x86/include/asm/cmpxchg_32.h:72 (set (reg:SI 3 bx)
        (reg:SI 2 cx [501])) 47 {*movsi_1} (nil))

If insn 1406 came right before insn 1407, it would be still correct.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Priority|P3                          |P1
   Last reconfirmed|0000-00-00 00:00:00         |2010-08-24 10:30:58
               date|                            |
            Summary|GCC 4.4.4 miscompiles (?)   |[4.4 Regression] GCC 4.4.4
                   |the Linux kernel, makes     |miscompiles the Linux kernel
                   |kernel unusable             |
   Target Milestone|---                         |4.4.5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45312

Reply via email to