This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/12372] [3.4 regression] miscompilation of execute/20030307-1.c at -O2 and -Os


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From danglin at gcc dot gnu dot org  2003-09-24 18:23 -------
The insns setting up the argument block on the stack are deleted in the
life pass.  We have this rtl after the cse2 pass:

(insn 18 17 19 0 /home/dave/gnu/gcc-3.4/gcc/gcc/testsuite/gcc.c-torture/execute/
20030307-1.c:12 (set (mem/f:DI (plus:SI (reg/f:SI 3 %r3)
                (const_int -56 [0xffffffc8])) [0 S8 A64])
        (reg/v:DI 99 [ count ])) 82 {*pa.md:3278} (nil)
    (nil))

(insn 19 18 20 0 /home/dave/gnu/gcc-3.4/gcc/gcc/testsuite/gcc.c-torture/execute/
20030307-1.c:12 (set (mem/f:SI (plus:SI (reg/f:SI 3 %r3)
                (const_int -60 [0xffffffc4])) [0 S4 A32])
        (reg/v:SI 100 [ type ])) 37 {*pa.md:2265} (nil)
    (nil))

(insn 20 19 21 0 /home/dave/gnu/gcc-3.4/gcc/gcc/testsuite/gcc.c-torture/execute/
20030307-1.c:12 (set (reg:SI 26 %r26 [ fd ])
        (reg/v:SI 96 [ fd ])) 37 {*pa.md:2265} (nil)
    (nil))

(insn 21 20 22 0 /home/dave/gnu/gcc-3.4/gcc/gcc/testsuite/gcc.c-torture/execute/
20030307-1.c:12 (set (reg:SI 25 %r25 [ op ])
        (reg/v:SI 97 [ op ])) 37 {*pa.md:2265} (nil)
    (nil))

(insn 22 21 23 0 /home/dave/gnu/gcc-3.4/gcc/gcc/testsuite/gcc.c-torture/execute/
20030307-1.c:12 (set (reg:DI 23 %r23 [ offset ])
        (reg/v:DI 98 [ offset ])) 82 {*pa.md:3278} (nil)
    (nil))

(call_insn/u/j 23 22 24 0 /home/dave/gnu/gcc-3.4/gcc/gcc/testsuite/gcc.c-torture
/execute/20030307-1.c:12 (parallel [
            (set (reg:SI 28 %r28)
                (call (mem:SI (symbol_ref/v:SI ("@fcntl_lock") <function_decl 0x
401e9850 fcntl_lock>) [0 S4 A32])
                    (const_int 28 [0x1c])))
            (clobber (reg:SI 1 %r1))
            (use (reg:SI 2 %r2))
            (use (const_int 0 [0x0]))
        ]) 217 {sibcall_value_internal_symref} (nil)
    (expr_list:REG_EH_REGION (const_int 0 [0x0])
        (nil))
    (expr_list (use (reg:DI 23 %r23 [ offset ]))
        (expr_list (use (reg:SI 25 %r25 [ op ]))
            (expr_list (use (reg:SI 26 %r26 [ fd ]))
                (nil)))))

Insns 18 and 19 get deleted because insn_dead_p in flow.c believes that
they are dead.  There isn't a use for the stack arguments in the sibcall
and the MEMs aren't marked as volatile.  So, there is nothing as far as
I can tell to stop them being deleted.  How's this supposed to work?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]