aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-10-03 11:49:37 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-10-03 11:49:37 +0200
commitbb81a576f259256b38d46dd41d3bd5f5a36cfd6f (patch)
tree28c0e11efe709cd4a763c5b39e4964ee54ef7f5f /gcc/combine.c
parent8398c1dfe24391ee18b6147d22415f30f7b82f2a (diff)
downloadgcc-bb81a576f259256b38d46dd41d3bd5f5a36cfd6f.zip
gcc-bb81a576f259256b38d46dd41d3bd5f5a36cfd6f.tar.gz
gcc-bb81a576f259256b38d46dd41d3bd5f5a36cfd6f.tar.bz2
re PR target/82386 (internal compiler error: Segmentation fault on 32-bit powerpc BE targets)
PR target/82386 * combine.c (combine_instructions): Don't combine in unreachable basic blocks. * gcc.dg/pr82386.c: New test. From-SVN: r253378
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index e502fa1..400cef3 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1232,6 +1232,12 @@ combine_instructions (rtx_insn *f, unsigned int nregs)
FOR_EACH_BB_FN (this_basic_block, cfun)
{
rtx_insn *last_combined_insn = NULL;
+
+ /* Ignore instruction combination in basic blocks that are going to
+ be removed as unreachable anyway. See PR82386. */
+ if (EDGE_COUNT (this_basic_block->preds) == 0)
+ continue;
+
optimize_this_for_speed_p = optimize_bb_for_speed_p (this_basic_block);
last_call_luid = 0;
mem_last_set = -1;