This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Removing redundant loads
- From: law at redhat dot com
- To: Jason Merrill <jason at redhat dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 30 May 2003 16:54:47 -0600
- Subject: Re: [tree-ssa] Removing redundant loads
- Reply-to: law at redhat dot com
In message <wvlof1k30qa.fsf@prospero.boston.redhat.com>, 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
>fine.
ARggh.
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
set.
<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>>
side-effects
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
in_system_header_flag>
chain <type_decl 0x30095600>>
side-effects
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
tree_decl>
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>
k.c:7>>
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
int>
k.c:3>>