]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/120341 - stores into STRING_CSTs can trap
authorRichard Biener <rguenther@suse.de>
Fri, 30 May 2025 11:47:55 +0000 (13:47 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 30 May 2025 13:11:37 +0000 (15:11 +0200)
commit02c58bc4b0885f5b6f50033da35768ebe6c4a030
treeb9b01692a4d54a0bd7c7fbdebc167858c7aa44b6
parent2ffada0296c95898a68bdb67ced738fe788df93a
tree-optimization/120341 - stores into STRING_CSTs can trap

The following fixes conditional store elimination and store motion
so they consider stores to STRING_CSTs as trapping.

PR tree-optimization/120341
* tree-ssa-loop-im.cc (can_sm_ref_p): STRING_CSTs are readonly.
* tree-ssa-phiopt.cc (cond_store_replacement): Likewise.

* gcc.dg/torture/pr120341-1.c: New testcase.
* gcc.dg/torture/pr120341-2.c: Likewise.
gcc/testsuite/gcc.dg/torture/pr120341-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr120341-2.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.cc
gcc/tree-ssa-phiopt.cc