This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Tree sharing issues...
- From: law at redhat dot com
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Richard Henderson <rth at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 19 Nov 2003 16:10:59 -0700
- Subject: Re: Tree sharing issues...
- Reply-to: law at redhat dot com
In message <20031119230806.GU11681@kam.mff.cuni.cz>, Jan Hubicka writes:
>> In message <20031119225619.GR11681@kam.mff.cuni.cz>, Jan Hubicka writes:
>> >> In message <20031119224619.GP11681@kam.mff.cuni.cz>, Jan Hubicka writes
>:
>> >> >> >OK, I will extend my sharing test by is_gimple_min_invariant. Do
>es t
>> >hat
>> >> >> >look right?
>> >> >> is_gimple_min_invariant (blah) && ! IS_EMPTY_STMT (blah) since I
>> >> >> believe the empty statement is (void) 0, but is not shared.
>> >> >>
>> >> >> Ugh.
>> >> >OK, another positive:
>> >> >../../gcc/caller-save.c:370: error: Wrong sharing of tree nodes
>> >> ># hard_regs_to_save_6 = VDEF <hard_regs_to_save_624>;
>> >> >hard_regs_to_save[1] = T.329_1370;
>> >> >
>> >> >hard_regs_to_save[1];
>> >> >
>> >> >../../gcc/caller-save.c:370: error: Wrong sharing of tree nodes
>> >> ># hard_regs_to_save_143 = VDEF <hard_regs_to_save_81>;
>> >> >hard_regs_to_save[1] = T.339_1393;
>> >> >
>> >> >hard_regs_to_save[1];
>> >> >
>> >> >../../gcc/caller-save.c:370: error: Wrong sharing of tree nodes
>> >> ># hard_regs_to_save_623 = VDEF <hard_regs_to_save_488>;
>> >> >hard_regs_to_save[1] = T.349_1416;
>> >> >
>> >> >hard_regs_to_save[1];
>> >> >
>> >> >../../gcc/caller-save.c:370: error: Wrong sharing of tree nodes
>> >> ># hard_regs_to_save_80 = VDEF <hard_regs_to_save_5>;
>> >> >hard_regs_to_save[1] = T.357_1437;
>> >> >
>> >> >hard_regs_to_save[1];
>> >> >
>> >> >
>> >> >This looks wrong. Seems to happen during jump threading...
>> >> I'm not sure why we wouldn't be sharing that node
>> >> (hard_regs_to_save[1]).
>> >>
>> >> Diego?
>> >I can add it into my definition of shareable nodes, if you tell me how
>> >to recognize these.
>>
>> TREE_ADDRESSABLE (var)
>> || decl_function_context (var) != current_function_decl
>> || may_aliases (var)
>>
>> Or something close to that.
>I am already allowing sharing of all DECL_P nodes. The node above is
>ARRAY_REF with constant operand, isn't it? So I need some kind of test
>"if array_ref is having all arguments constant, then it can be shared"
>or am I wrong?
Well, you also need to allow sharing of certain constants, SSA_NAME nodes
and probably other stuff.
Fundamentally trees haven't had well defined sharing rules, so you're going
to largely have to "figure things out and document them".
Jeff