https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110799
--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:064a4ec9d7107c8278a759cb61dc161548c846ee commit r13-7612-g064a4ec9d7107c8278a759cb61dc161548c846ee Author: Richard Biener <rguent...@suse.de> Date: Wed Jul 26 09:28:10 2023 +0200 tree-optimization/110799 - fix bug in code hoisting Code hoisting part of GIMPLE PRE failed to adjust the TBAA behavior of common loads in the case the alias set of the ref was the same but the base alias set was not. It also failed to adjust the base behavior, assuming it would match. The following plugs this hole. PR tree-optimization/110799 * tree-ssa-pre.cc (compute_avail): More thoroughly match up TBAA behavior of redundant loads. * gcc.dg/torture/pr110799.c: New testcase. (cherry picked from commit 565e0e80660dac24e5193873ca07542b99cd8bc3)