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: [trunk][patch] fix another invalid sharing in see


"Rafael Espindola" <espindola@google.com> writes:

> * see.c(see_def_extension_not_merged): Use copy_rtx to avoid invalid sharing.
>
> * gcc.c-torture/compile/20080523-1.c: New testcase.

In the future, it's better if you provide a complete ChangeLog entry,
with the date, your name, etc.  Look at other patch submissions on
gcc-patches.  In this case: space before left parenthesis in first
line; first line is too long.


>    /* Create a simple move instruction to assure the correctness of the code.  */
>    start_sequence ();
> -  emit_insn (ref_copy);
> +  emit_insn (copy_rtx (ref_copy));
>    emit_move_insn (dest_reg, subreg);
>    if (merged_ref_next != NULL_RTX)
>      emit_insn (merged_ref_next);

I need to see more details.  This doesn't look right.  ref_copy was
set like this:
  rtx ref_copy = see_copy_insn (ref);
So it is already a copy.  Why do we need to copy it again?

It was changed here:
  ref_copy = replace_rtx (ref_copy, dest_reg, copy_rtx (subreg));

Is the problem in this case that the copied subreg is being inserted
into the insn in two different places?

Thanks.

Ian


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