From 69e1a1a34fca2f15d0bb313c425d6a7f85a4bb4d Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Mon, 22 Oct 2012 22:09:22 +0000 Subject: [PATCH] re PR tree-optimization/55008 (Internal compiler error : verify_ssa failed) gcc: 2012-10-22 Bill Schmidt PR tree-optimization/55008 * gimple-ssa-strength-reduction.c (find_basis_for_candidate): Don't allow a candidate to be a basis for itself under another interpretation. gcc/testsuite: 2012-10-22 Bill Schmidt PR tree-optimization/55008 * gcc.dg/tree-ssa/pr55008.c: New test. From-SVN: r192696 --- gcc/ChangeLog | 6 ++++++ gcc/gimple-ssa-strength-reduction.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/tree-ssa/pr55008.c | 17 +++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr55008.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3794f50c64b..e25a8ae9048 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-10-22 Bill Schmidt + + PR tree-optimization/55008 + * gimple-ssa-strength-reduction.c (find_basis_for_candidate): Don't + allow a candidate to be a basis for itself under another interpretation. + 2012-10-22 Sharad Singhai * dumpfile.c (dump_phase_enabled_p): Renamed dump_enabled_p. Update diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index 46600a57f81..0523854027f 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -366,6 +366,7 @@ find_basis_for_candidate (slsr_cand_t c) slsr_cand_t one_basis = chain->cand; if (one_basis->kind != c->kind + || one_basis->cand_stmt == c->cand_stmt || !operand_equal_p (one_basis->stride, c->stride, 0) || !types_compatible_p (one_basis->cand_type, c->cand_type) || !dominated_by_p (CDI_DOMINATORS, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c994df96272..243d74e352d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-10-22 Bill Schmidt + + PR tree-optimization/55008 + * gcc.dg/tree-ssa/pr55008.c: New test. + 2012-10-22 Richard Biener PR tree-optimization/55011 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr55008.c b/gcc/testsuite/gcc.dg/tree-ssa/pr55008.c new file mode 100644 index 00000000000..32af32a8044 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr55008.c @@ -0,0 +1,17 @@ +/* This used to fail to compile; see PR55008. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -w" } */ + +typedef unsigned long long T; + +void f(void) +{ + int a, *p; + + T b = 6309343725; + + if(*p ? (b = 1) : 0) + if(b - (a = b /= 0) ? : (a + b)) + while(1); +} +