aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.cc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2025-12-06 20:11:46 -0300
committerAlexandre Oliva <oliva@gnu.org>2025-12-06 20:11:46 -0300
commit488e28a80eeabf6adb791a516e6cdd3a7dd890ca (patch)
tree4493debe3f32fc96f6928d375bdceccdc206e020 /gcc/fortran/resolve.cc
parentfb8a9da75a4962e2a79eef640364d2544b1319ee (diff)
downloadgcc-488e28a80eeabf6adb791a516e6cdd3a7dd890ca.zip
gcc-488e28a80eeabf6adb791a516e6cdd3a7dd890ca.tar.gz
gcc-488e28a80eeabf6adb791a516e6cdd3a7dd890ca.tar.bz2
add fusage for non-ACCUMULATE_OUTGOING_ARGS calls [PR122947]
Since we may delete stores that are found to be redundant in postreload cse, we need cselib to invalidate argument stores at calls, and to that end we need CALL_INSN_FUNCTION_USAGE to mention all MEM stack space that may be legitimately modified by a const/pure callee, i.e., all arguments passed to it on the stack. When ACCUMULATE_OUTGOING_ARGS, each on-stack argument gets its own usage information, but when it's not, each argument is pushed incrementally, without precomputed stack slots. Since we only mentioned such precomputed stack slots in CALL_INSN_FUNCTION_USAGE, non-ACCUMULATE_OUTGOING_ARGS configurations miss the stack usage data, and cselib fails to invalidate the stores. Stores in such slots are anonymous, and they often invalidate other anonymous slots, even part of the same object, but as the testcase demonstrates, we may occasionally be unlucky that consecutive calls have the stores to multi-word objects reordered by scheduling in such a way that the last store for the first call survives the call in the cselib tables, and then it is found to be redundant with the first store for the subsequent call, as in the testcase. So, if we haven't preallocated outgoing arguments for a call (which would give us preassigned stack slots), and we have used any stack space, add function call usage covering the entire stack range where arguments were stored. for gcc/ChangeLog PR rtl-optimization/122947 * calls.cc (expand_call): Add stack function usage in non-ACCUMULATE_OUTGOING_ARGS configurations. for gcc/testsuite/ChangeLog PR rtl-optimization/122947 * gcc.dg/pr122947.c: New.
Diffstat (limited to 'gcc/fortran/resolve.cc')
0 files changed, 0 insertions, 0 deletions