diff options
author | Richard Biener <rguenther@suse.de> | 2021-02-22 08:36:55 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-02-22 08:38:14 +0100 |
commit | 8a8eee6bdb906788992622715bf97aff984ac989 (patch) | |
tree | 761aa7503d0a215576833d687ab5624cb46f3013 /gcc | |
parent | 60b99ee3bc0577724efe5a1023eb0a9db60d3ad5 (diff) | |
download | gcc-8a8eee6bdb906788992622715bf97aff984ac989.zip gcc-8a8eee6bdb906788992622715bf97aff984ac989.tar.gz gcc-8a8eee6bdb906788992622715bf97aff984ac989.tar.bz2 |
tree-optimization/99165 - fix ICE in store-merging w/ non-call EH
This adds a missing accumulation to ret.
2021-02-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/99165
* gimple-ssa-store-merging.c (pass_store_merging::process_store):
Accumulate changed to ret.
* g++.dg/pr99165.C: New testcase.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimple-ssa-store-merging.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pr99165.C | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c index b4c5e8e..213c155 100644 --- a/gcc/gimple-ssa-store-merging.c +++ b/gcc/gimple-ssa-store-merging.c @@ -5230,7 +5230,7 @@ pass_store_merging::process_store (gimple *stmt) if (idx >= (unsigned)param_max_store_chains_to_track || (n_stores + (*e)->m_store_info.length () > (unsigned)param_max_stores_to_track)) - terminate_and_process_chain (*e); + ret |= terminate_and_process_chain (*e); else { n_stores += (*e)->m_store_info.length (); diff --git a/gcc/testsuite/g++.dg/pr99165.C b/gcc/testsuite/g++.dg/pr99165.C new file mode 100644 index 0000000..70ffd03 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr99165.C @@ -0,0 +1,7 @@ +// { dg-do compile } +// { dg-options "-O2 -fnon-call-exceptions --param=max-stores-to-track=2" } + +struct A { + A() : i() {} + int i; +} *ap2 = new A[3]; |