]> git.ipfire.org Git - thirdparty/gcc.git/commit
treat argp-based mem as frame related in dse
authorJiufu Guo <guojiufu@linux.ibm.com>
Tue, 19 Dec 2023 05:03:06 +0000 (13:03 +0800)
committerguojiufu <guojiufu@linux.ibm.com>
Tue, 19 Dec 2023 05:18:40 +0000 (13:18 +0800)
commit4759383245ac97a5c83c0272f0a831f2a26ea5c1
treea97da9e1e04b2b3fc23bd4651dd6abe632b76ceb
parentcaa2d2a588c028393fa153ddddb893040f8f9833
treat argp-based mem as frame related in dse

The issue mentioned in PR112525 would be able to be handled by
updating dse.cc to treat arg_pointer_rtx similarly with frame_pointer_rtx.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271#c10 also mentioned
this idea.

And arpg area may be used to pass argument to callee. So, it would
be needed to check if call insns are using that mem.

PR rtl-optimization/112525
PR target/30271

gcc/ChangeLog:

* dse.cc (get_group_info): Add arg_pointer_rtx as frame_related.
(check_mem_read_rtx): Add parameter to indicate if it is checking mem
for call insn.
(scan_insn): Add mem checking on call usage.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr112525.c: New test.
* gcc.target/powerpc/pr30271.c: New test.
gcc/dse.cc
gcc/testsuite/gcc.target/powerpc/pr112525.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pr30271.c [new file with mode: 0644]