https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78614

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This looks like a bug in rs6000_frame_related.
It wants to add REG_FRAME_RELATED_EXPR note with the PATTERN with possibly some
replacements in it.  RTL sharing rules requires that no non-shareable rtl is
shared in between those two spots.  simplify_replace_rtx does not guarantee
this, it only guarantees that the original expression is not modified.
The rtxes containing anything that got changed will be copies, but if there are
other expressions (other operands etc.), those are not copied.
One option, perhaps wasting some memory, is to just use copy_rtx (pat) first,
before
+  pat = copy_rtx (pat);
   if (GET_CODE (pat) == SET)
then
      pat = shallow_copy_rtx (pat);
      XVEC (pat, 0) = shallow_copy_rtvec (XVEC (pat, 0));
is not necessary.  Another one is that copy_rtx and just avoid using
simplify_replace_rtx unless you really want to simplify - and instead just use
rtl iterator to walk subexpressions and whenever you see reg or reg2 copy_rtx
(repl) or copy_rtx (repl2) in there.

Reply via email to