[tree-ssa] Treat ASM_EXPR operands as real operands [patch]

Diego Novillo dnovillo@redhat.com
Tue Jul 22 19:20:00 GMT 2003


On Tue, 2003-07-22 at 15:00, Jason Merrill wrote:
> On 22 Jul 2003 14:15:49 -0400, Diego Novillo <dnovillo@redhat.com> wrote:
> 
> > On Tue, 2003-07-22 at 14:01, Jason Merrill wrote:
> >> Hmm.  You could probably use DECL_RTL_SET_P, but that seems fragile.
> 
> > It's still not set when we are in the tree optimizers.
> 
> It sure looks like it should be for a decl with an explicit asm specifier;
> finish_decl calls rest_of_decl_compilation, which calls make_decl_rtl if
> there's an asmspec.
> 
It's definitely not the case here.  Oddly, finish_decl is *never* called
in this program.  I set a breakpoint in cp/decl.c:finish_decl and it
never triggered.  Perhaps that's the bug?  Where should it be called
from?

This is how things are just when we are about to copy propagate T.1233
into ar_ccv:

(gdb) ptu stmt
__asm__ __volatile__("cmpxchg8.rel %0=%1,%2,%4":"=r" out_130, "=m" *addr_126:"r" T.1242_125, "m" *he.1241_124, "d" ar_ccv_129:"memory");

(gdb) down
#0  propagate_copy (op_p=0x2000000001ab62b0, var=0x2000000001b01c80)
    at /home/dnovillo/perf/sbox/tree-ssa-branch/local/src/gcc/tree-ssa-copyprop.c:225
225       *op_p = var;
(gdb) pt op_p.ssa_name.var
 <var_decl 0x2000000001ab31e0 ar_ccv
    type <integer_type 0x2000000000334d20 long unsigned int unsigned asm_written DI
        size <integer_cst 0x200000000032cf80 constant 64>
        unit size <integer_cst 0x200000000032d140 constant 8>
        align 64 symtab 4142496 alias set -1 precision 64 min <integer_cst 0x200000000032d200 0> max <integer_cst 0x200000000032d240 18446744073709551615>
        pointer_to_this <pointer_type 0x200000000050d6c0>>
    unsigned used tree_1 common regdecl decl_4 DI file sysdep/locks.h line 41
    size <integer_cst 0x2000000001ab6540 type <integer_type 0x20000000003373a0 bit_size_type> constant 64>
    unit size <integer_cst 0x2000000001ab6580 type <integer_type 0x20000000003372c0 long unsigned int> constant 8>
    align 64 context <function_decl 0x20000000006a2840 _Jv_MonitorExit> abstract_origin <var_decl 0x2000000001698540 ar_ccv> chain <var_decl 0x2000000001ab32c0 out>
    sysdep/locks.h:41>

(gdb) pt var.ssa_name.var
 <var_decl 0x2000000001ab01c0 T.1233
    type <integer_type 0x2000000001689ce0 obj_addr_t unsigned asm_written DI
        size <integer_cst 0x200000000032cf80 constant 64>
        unit size <integer_cst 0x200000000032d140 constant 8>
        align 64 symtab 23427328 alias set -1 precision 64 min <integer_cst 0x200000000032d200 0> max <integer_cst 0x200000000032d240 18446744073709551615>>
    unsigned used DI file /home/dnovillo/perf/sbox/tree-ssa-branch/local/src/libjava/java/lang/natObject.cc line 931 size <integer_cst 0x200000000032cf80 64> unit size <integer_cst 0x200000000032d140 8>
    align 64 context <function_decl 0x20000000006a2840 _Jv_MonitorExit> chain <var_decl 0x2000000001ab02a0 T.1234>
    /home/dnovillo/perf/sbox/tree-ssa-branch/local/src/libjava/java/lang/natObject.cc:931>
(gdb) p op_p.ssa_name.var.decl.rtl
$4 = (struct rtx_def *) 0x0


op_p is the pointer to the SSA_NAME that we are copy propagating into.


Diego.



More information about the Gcc-patches mailing list