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

Re: [PATCH] Unshare constants in the constant pool (PR target/42894)


On Wed, Jan 26, 2011 at 06:29:25PM -0700, Jeff Law wrote:
> > As discussed in the PR, if a non-shareable constant is force_const_mem
> > and the original expression is used elsewhere in the IL (e.g. in REG_EQUAL
> > or REG_EQUIV note), unshare_all_rtl doesn't unshare it, but modification of
> > the IL might result in changes of the constant in theory and if
> > avoid_constant_pool_reference result is then pushed somewhere else into the
> > IL, we get RTL sharing errors (as on arm on this testcase).
> Well, one could easily argue that using the original expression in the
> REG_EQUAL note is incorrect as well.  In fact, looking over all the
> calls to set_unique_reg_note shows that most either copy the value or
> generate a new one.
> 
> I think that means we actually want both the varasm.c and the expr.c
> change to avoid incorrect sharing.

I think the reason why most of the set_unique_reg_note calls copy_rtx
is that the pattern is usually kept in the insn (or in some other insn).
In the emit_move_insn case it specifically tests that the pattern is not
there (well, some weird target could embed it in some unspec or something),
the reason I changed force_const_mem was to deal with any other uses of
force_const_mem.

But I guess if you strongly prefer to have it in both places I can test a
patch.

	Jakub


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