This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [trunk][patch] fix another invalid sharing in see
- From: Ian Lance Taylor <iant at google dot com>
- To: "Rafael Espindola" <espindola at google dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 23 May 2008 10:37:05 -0700
- Subject: Re: [trunk][patch] fix another invalid sharing in see
- References: <38a0d8450805230158g1a7066c4g321d8d9c296d8710@mail.gmail.com>
"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