Fix segfault with -O2 -fnon-call-exceptions -ftracer
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 23 Apr 2020 20:25:04 +0000 (22:25 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 23 Apr 2020 20:28:02 +0000 (22:28 +0200)
commitcb76fcd7fb4a4f1e4d1688deca87969124f16fef
treee88afac8754c40f70acbb0ebce17d70724c25505
parent431ee3581584c533acc77ab840d9ad71f45b9831
Fix segfault with -O2 -fnon-call-exceptions -ftracer

The GIMPLE SSA store merging pass blows up when it is rewriting the
stores because it didn't realize that they don't belong to the same
EH region.  Fixed by refusing to merge them.

PR tree-optimization/94717
* gimple-ssa-store-merging.c (try_coalesce_bswap): Return false if
one of the stores doesn't have the same landing pad number as the
first.
(coalesce_immediate_stores): Do not try to coalesce the store using
bswap if it doesn't have the same landing pad number as the first.
gcc/ChangeLog
gcc/gimple-ssa-store-merging.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/store-merging-4.C [new file with mode: 0644]