This is the mail archive of the 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]

Re: [tree-ssa] Removing redundant loads

In message <>, Jason Merrill writes:
 >> Yes, avail_expr_eq has the same issue, but it's a little more "interesting"
 >> in that we call back to simple_cst_equal which doesn't handle commutative
 >> expressions well.
 >I use operand_equal_p in gimple_tree_eq; it handles commutativity just

operand_equal_p returns false if either operand has side effects -- even
if both operands are equal.

For example, if you pass it this tree for both operands, you'll get a
false back from operand_b because this expression has tree_side_effects

 <component_ref 0x30090fe0
    type <integer_type 0x3004c480 unsigned int unsigned SI
        size <integer_cst 0x30051300 constant 32>
        unit size <integer_cst 0x30051440 constant 4>
        align 32 symtab 0 alias set -1 precision 32 min <integer_cst 
0x300514c0 0> max <integer_cst 0x30051500 4294967295>>
    arg 0 <component_ref 0x30090fa0
        type <record_type 0x30095580 tree_decl type_0 SI
            size <integer_cst 0x30053240 constant 32>
            unit size <integer_cst 0x30053300 constant 4>
            align 32 symtab 0 alias set 4 fields <field_decl 0x30095680 
            chain <type_decl 0x30095600>>
        arg 0 <indirect_ref 0x30090f60 type <union_type 0x30095700 tree_node>
            arg 0 <ssa_name 0x30097460 type <pointer_type 0x30095980 tree>
        arg 1 <field_decl 0x30095800 decl type <record_type 0x30095580 
            SI file k.c line 7 size <integer_cst 0x30053240 32> unit size 
<integer_cst 0x30053300 4>
            align 32 offset_align 128
            offset <integer_cst 0x30053340 constant 0>
            bit offset <integer_cst 0x30053500 constant 0> context <union_type 
0x30095700 tree_node> arguments <integer_cst 0x30053340 0>
    arg 1 <field_decl 0x30095680 in_system_header_flag type <integer_type 
0x3004c480 unsigned int>
        unsigned bit-field nonaddressable decl_4 SI file k.c line 3
        size <integer_cst 0x300531c0 constant 1>
        unit size <integer_cst 0x30053200 constant 1>
        align 1 offset_align 128 offset <integer_cst 0x30053340 0> bit offset 
<integer_cst 0x30053500 0> context <record_type 0x30095580 tree_decl> 
arguments <integer_cst 0x30053340 0> result <integer_type 0x3004c480 unsigned 

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