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



--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-27 
09:56:12 UTC ---

Note it isn't just call arg info, also NOTE_INSN_VAR_LOCATION for variable l.

Without any of the patches we have (testcase from previous comment):

(note 55 2 41 2 (var_location l (const_int 0 [0])) NOTE_INSN_VAR_LOCATION)

...

(note 56 7 35 2 (var_location l (reg:SI 0 ax [orig:68 l ] [68]))

NOTE_INSN_VAR_LOCATION) ! right after asm volatile

...

(insn 22 40 57 2 (parallel [

            (set (reg:SI 0 ax [orig:76 D.1390 ] [76])

                (plus:SI (reg:SI 0 ax [orig:68 l ] [68])

                    (const_int 1 [0x1])))

            (clobber (reg:CC 17 flags))

        ]) ./pr36728-4.c:9 271 {*addsi_1}

     (expr_list:REG_UNUSED (reg:CC 17 flags)

        (expr_list:REG_EQUIV (mem:SI (reg/f:SI 7 sp) [0 S4 A32])

            (nil))))

(note 57 22 21 2 (var_location l (reg:SI 0 ax [orig:68 l ] [68]))

NOTE_INSN_VAR_LOCATION)



note 57 is wrong, obviously l doesn't have at that point value %eax, but %eax -

1.

With the patch from the previous comment, 

(note 57 22 21 2 (var_location l (const_int 0 [0])) NOTE_INSN_VAR_LOCATION)

instead (also wrong, the compiler can't assume the inline asm hasn't changed

the register).  What if it is

asm volatile ("incl %0" : "=r" (l) : "0" (l));

instead.

Reply via email to