aboutsummaryrefslogtreecommitdiff
path: root/gcc/ree.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2014-01-10 15:13:18 -0700
committerJeff Law <law@gcc.gnu.org>2014-01-10 15:13:18 -0700
commit7e41c852e38703c9a7f9ec1d4c513d781f1e46a6 (patch)
treea0b2ee5cd9b29270bf09ee2463c088556c88e09c /gcc/ree.c
parentb270b096a14b869e59e10ca879b5cffa65ea3fd5 (diff)
downloadgcc-7e41c852e38703c9a7f9ec1d4c513d781f1e46a6.zip
gcc-7e41c852e38703c9a7f9ec1d4c513d781f1e46a6.tar.gz
gcc-7e41c852e38703c9a7f9ec1d4c513d781f1e46a6.tar.bz2
re PR middle-end/59743 (ICE: Segmentation fault)
PR middle-end/59743 * ree.c (combine_reaching_defs): Ensure the defining statement occurs before the extension when optimizing extensions with different source and destination hard registers. PR middle-end/59743 * gcc.c-torture/compile/pr59743.c: New test. From-SVN: r206545
Diffstat (limited to 'gcc/ree.c')
-rw-r--r--gcc/ree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ree.c b/gcc/ree.c
index 01ccd69..63cc8cc 100644
--- a/gcc/ree.c
+++ b/gcc/ree.c
@@ -723,8 +723,10 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
/* The defining statement and candidate insn must be in the same block.
This is merely to keep the test for safety and updating the insn
- stream simple. */
- if (BLOCK_FOR_INSN (cand->insn) != BLOCK_FOR_INSN (def_insn))
+ stream simple. Also ensure that within the block the candidate
+ follows the defining insn. */
+ if (BLOCK_FOR_INSN (cand->insn) != BLOCK_FOR_INSN (def_insn)
+ || DF_INSN_LUID (def_insn) > DF_INSN_LUID (cand->insn))
return false;
/* If there is an overlap between the destination of DEF_INSN and