From aa2e903e1d7f30c546b4e77f0aa71dff6c95754f Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 28 Nov 2018 11:01:06 +0000 Subject: [PATCH] re PR tree-optimization/79351 (Invalid tree PRE optimization around compound literal) 2018-11-28 Richard Biener PR tree-optimization/79351 * tree-ssa-sccvn.c (vn_reference_lookup_3): For assignments from empty CONSTRUCTORs ensure the store is at a constant position. * gcc.dg/torture/pr79351.c: New testcase. From-SVN: r266551 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 7 ++++++- gcc/testsuite/gcc.dg/torture/pr79351.c | 26 ++++++++++++++++++++++++++ gcc/tree-ssa-sccvn.c | 1 + 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr79351.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 93b35e87c5c..d1123888cb8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-28 Richard Biener + + PR tree-optimization/79351 + * tree-ssa-sccvn.c (vn_reference_lookup_3): For assignments from + empty CONSTRUCTORs ensure the store is at a constant position. + 2018-11-28 Richard Biener PR tree-optimization/88229 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5d3b2d12664..b56d3dc40dd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-28 Richard Biener + + PR tree-optimization/79351 + * gcc.dg/torture/pr79351.c: New testcase. + 2018-11-28 Jakub Jelinek PR target/88189 @@ -13,7 +18,7 @@ PR c++/88215 * c-c++-common/ubsan/pr88215.c: New test. -2018-10-19 Richard Biener +2018-11-28 Richard Biener PR tree-optimization/88182 * g++.dg/gomp/pr88182.C: Move from libgomp and use -fopenmp-simd. diff --git a/gcc/testsuite/gcc.dg/torture/pr79351.c b/gcc/testsuite/gcc.dg/torture/pr79351.c new file mode 100644 index 00000000000..0e145eb7e3b --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr79351.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ + +static struct state { + int k; + int dummy; +} states[256]; + +__attribute((noipa)) +static void +ismatch(int n) +{ + for (int j=0; j