When merging BBs, phi-sources from the bottom BB should 'overwrite' the ones from the top BB which should be ignored. This is currently the not case and both phi-sources are present in the resulting BB. This doesn't make much sense for the corresponding phi-node and also causes other problems like hindering further simplifications. This series contains a testcase and a patch for this. Luc Van Oostenryck (2): add testcase for phi-adjusting during BB merge adjust phi-sources when merging BBs flow.c | 28 +++++++++++++++++++++++++ validation/optim/merge_bbe-adjust_phi.c | 23 ++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 validation/optim/merge_bbe-adjust_phi.c -- 2.29.2