This is a set of 3 patches which fix phiprop for proping back
into a loop. Instead of not always doing it; only disabling it
for possible trapping cases. And also if there is an unconditional
load already, we can handle it for the conditional load too.
Also the last patch fixes the case where the load is unconditional
but one of the addresses can cause a trap, we want to still not prop
back into the loop (fix from Richi).
Adds multiple testcases including one for PR60183 as the one that
was added for that phiprop was not acting on it any more due to
other patches that was done for phiprop later on.

Andrew Pinski (3):
  phiprop: Allow non-trapping loads to be proped back into the loop
  phiprop: allowing prop into loop if there is a phi already
  phiprop: Avoid proping loads into loops [PR116835]

 gcc/testsuite/gcc.dg/torture/pr116835.c   | 33 ++++++++++++
 gcc/testsuite/gcc.dg/tree-ssa/phiprop-3.c | 25 +++++++++
 gcc/testsuite/gcc.dg/tree-ssa/phiprop-4.c | 26 ++++++++++
 gcc/testsuite/gcc.dg/tree-ssa/phiprop-5.c | 26 ++++++++++
 gcc/testsuite/gcc.dg/tree-ssa/phiprop-6.c | 21 ++++++++
 gcc/testsuite/gcc.dg/tree-ssa/phiprop-7.c | 21 ++++++++
 gcc/tree-ssa-phiprop.cc                   | 63 +++++++++++++++++------
 7 files changed, 200 insertions(+), 15 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/torture/pr116835.c
 create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phiprop-3.c
 create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phiprop-4.c
 create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phiprop-5.c
 create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phiprop-6.c
 create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phiprop-7.c

-- 
2.43.0

Reply via email to