https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83047
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Tue Nov 21 08:41:47 2017 New Revision: 254992 URL: https://gcc.gnu.org/viewcvs?rev=254992&root=gcc&view=rev Log: PR tree-optimization/83047 * gimple-ssa-store-merging.c (imm_store_chain_info::output_merged_store): If the loads with the same vuse are in different basic blocks, for load_gsi pick a load location that is dominated by the other loads. * gcc.dg/pr83047.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr83047.c Modified: trunk/gcc/ChangeLog trunk/gcc/gimple-ssa-store-merging.c trunk/gcc/testsuite/ChangeLog