aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-03-10 08:57:45 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-03-10 08:57:45 +0100
commit2d9dd4fb867bffd009ebc85896dceb932559d90a (patch)
tree859f76c7bfa5b01e9fbcd6007700545c2a15875c /gcc/combine.c
parent72772e6761c5930db346e5cdc2a1537585940502 (diff)
downloadgcc-2d9dd4fb867bffd009ebc85896dceb932559d90a.zip
gcc-2d9dd4fb867bffd009ebc85896dceb932559d90a.tar.gz
gcc-2d9dd4fb867bffd009ebc85896dceb932559d90a.tar.bz2
re PR middle-end/79909 (ICE error: invalid rtl sharing found in the insn on ppc64le)
PR rtl-optimization/79909 * combine.c (try_combine): Use simplify_replace_rtx on individual CALL_INSN_FUNCTION_USAGE elements instead of replace_rtx on copy_rtx of the whole CALL_INSN_FUNCTION_USAGE. * gcc.target/powerpc/pr79909.c: New test. From-SVN: r246023
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index b5c0c18..66215a6 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -4293,26 +4293,25 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
if (CALL_P (i3) && CALL_INSN_FUNCTION_USAGE (i3))
{
- rtx call_usage = CALL_INSN_FUNCTION_USAGE (i3);
-
- reset_used_flags (call_usage);
- call_usage = copy_rtx (call_usage);
-
- if (substed_i2)
+ for (rtx link = CALL_INSN_FUNCTION_USAGE (i3); link;
+ link = XEXP (link, 1))
{
- /* I2SRC must still be meaningful at this point. Some splitting
- operations can invalidate I2SRC, but those operations do not
- apply to calls. */
- gcc_assert (i2src);
- replace_rtx (call_usage, i2dest, i2src);
+ if (substed_i2)
+ {
+ /* I2SRC must still be meaningful at this point. Some
+ splitting operations can invalidate I2SRC, but those
+ operations do not apply to calls. */
+ gcc_assert (i2src);
+ XEXP (link, 0) = simplify_replace_rtx (XEXP (link, 0),
+ i2dest, i2src);
+ }
+ if (substed_i1)
+ XEXP (link, 0) = simplify_replace_rtx (XEXP (link, 0),
+ i1dest, i1src);
+ if (substed_i0)
+ XEXP (link, 0) = simplify_replace_rtx (XEXP (link, 0),
+ i0dest, i0src);
}
-
- if (substed_i1)
- replace_rtx (call_usage, i1dest, i1src);
- if (substed_i0)
- replace_rtx (call_usage, i0dest, i0src);
-
- CALL_INSN_FUNCTION_USAGE (i3) = call_usage;
}
if (undobuf.other_insn)