aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2021-01-19 11:28:48 +0100
committerMartin Jambor <mjambor@suse.cz>2021-01-19 11:28:48 +0100
commit9b8741c98f2876a430c12c85b396d29a87c9c488 (patch)
treecac01a751df51631480bf1ddeba8360e81f49661 /gcc/tree-inline.c
parent665e80ca5ec84ccf77d5e18d7ca802d38d5e270d (diff)
downloadgcc-9b8741c98f2876a430c12c85b396d29a87c9c488.zip
gcc-9b8741c98f2876a430c12c85b396d29a87c9c488.tar.gz
gcc-9b8741c98f2876a430c12c85b396d29a87c9c488.tar.bz2
ipa-sra: Do not remove return values needed because of non-call EH
IPA-SRA already contains a check to figure out that an otherwise dead parameter is actually required because of non-call exceptions, but it is not present at the equivalent spot where SRA figures out whether the return statement is used for anything useful. This patch adds that condition there. Unfortunately, even though this patch should be good enough for any normal (I'd even say reasonable) use of the compiler, it hints that when the user manually switches all sorts of DCE, IPA-SRA would probably leave behind problematic statements manipulating what originally were return values, just like it does for parameters (PR 93385). Fixing this properly might unfortunately be a separate issue from the mentioned bug because the LHS of a call is changed during call redirection and the caller often is not a clone. But I'll see what I can do. Meanwhile, the patch below has been bootstrapped and tested on x86_64. gcc/ChangeLog: 2021-01-18 Martin Jambor <mjambor@suse.cz> PR ipa/98690 * ipa-sra.c (ssa_name_only_returned_p): New parameter fun. Check whether non-call exceptions allow removal of a statement. (isra_analyze_call): Pass the appropriate function to ssa_name_only_returned_p. gcc/testsuite/ChangeLog: 2021-01-18 Martin Jambor <mjambor@suse.cz> PR ipa/98690 * g++.dg/ipa/pr98690.C: New test.
Diffstat (limited to 'gcc/tree-inline.c')
0 files changed, 0 insertions, 0 deletions