aboutsummaryrefslogtreecommitdiff
path: root/gcc/range-op.cc
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2023-11-29 16:24:33 +0100
committerMartin Jambor <mjambor@suse.cz>2023-11-29 16:25:26 +0100
commit302461ad9a04d82fee904bddac69811d13d5bb6a (patch)
treeb871d3e45495f9d38d703c340de238ac426b0445 /gcc/range-op.cc
parent4c909c6ee381a43081d68abc1ff8a35ce20d24d9 (diff)
downloadgcc-302461ad9a04d82fee904bddac69811d13d5bb6a.zip
gcc-302461ad9a04d82fee904bddac69811d13d5bb6a.tar.gz
gcc-302461ad9a04d82fee904bddac69811d13d5bb6a.tar.bz2
tree-sra: Avoid returns of references to SRA candidates
The enhancement to address PR 109849 contained an importsnt thinko, and that any reference that is passed to a function and does not escape, must also not happen to be aliased by the return value of the function. This has quickly transpired as bugs PR 112711 and PR 112721. Just as IPA-modref does a good enough job to allow us to rely on the escaped set of variables, it sems to be doing well also on updating EAF_NOT_RETURNED_DIRECTLY call argument flag which happens to address exactly the situation we need to avoid. Of course, if a call statement ignores any returned value, we also do not need to check the flag. Hopefully this does not pessimize things too much, I have verified that the PR 109849 testcae remains quick and so should also the benchmark it is derived from. gcc/ChangeLog: 2023-11-27 Martin Jambor <mjambor@suse.cz> PR tree-optimization/112711 PR tree-optimization/112721 * tree-sra.cc (build_access_from_call_arg): New parameter CAN_BE_RETURNED, disqualify any candidate passed by reference if it is true. Adjust leading comment. (scan_function): Pass appropriate value to CAN_BE_RETURNED of build_access_from_call_arg. gcc/testsuite/ChangeLog: 2023-11-29 Martin Jambor <mjambor@suse.cz> PR tree-optimization/112711 PR tree-optimization/112721 * g++.dg/tree-ssa/pr112711.C: New test. * gcc.dg/tree-ssa/pr112721.c: Likewise.
Diffstat (limited to 'gcc/range-op.cc')
0 files changed, 0 insertions, 0 deletions