From 9d2681a399507e4a33e95e3f738e7328b8abcc90 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Thu, 15 May 2014 16:54:29 +0200 Subject: [PATCH] re PR tree-optimization/61090 (ICE in build_ref_for_offset) 2014-05-15 Martin Jambor PR tree-optimization/61090 * tree-sra.c (sra_modify_expr): Pass the current gsi to build_ref_for_model. testsuite/ * gcc.dg/tree-ssa/pr61090.c: New test. From-SVN: r210476 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/tree-ssa/pr61090.c | 21 +++++++++++++++++++++ gcc/tree-sra.c | 2 +- 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr61090.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4b818f41b890..960927c72280 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-05-15 Martin Jambor + + PR tree-optimization/61090 + * tree-sra.c (sra_modify_expr): Pass the current gsi to + build_ref_for_model. + 2014-05-15 Kyrylo Tkachov * config/arm/arm.c (arm_option_override): Use the SCHED_PRESSURE_MODEL diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ae257928bda0..0a43475ee70f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-05-15 Martin Jambor + + PR tree-optimization/61090 + * gcc.dg/tree-ssa/pr61090.c: New test. + 2014-05-15 Jakub Jelinek PR tree-optimization/61158 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr61090.c b/gcc/testsuite/gcc.dg/tree-ssa/pr61090.c new file mode 100644 index 000000000000..fff289572ac5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr61090.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +struct i { + int c; +}; + +static int +p(struct i a) +{ + return 0; +} + +void +h(void) +{ + struct i z[] = {{ 0 }}; + int e[] = {}; + int x; + e[0] = p(z[x]) + z[x].c; +} diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 72c485be5215..ef6c96672aae 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -2812,7 +2812,7 @@ sra_modify_expr (tree *expr, gimple_stmt_iterator *gsi, bool write) { tree ref; - ref = build_ref_for_model (loc, orig_expr, 0, access, NULL, false); + ref = build_ref_for_model (loc, orig_expr, 0, access, gsi, false); if (write) { -- 2.43.5