From 15b6695ac534148a10dd5a5f266bf2e49316dc32 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 24 Nov 2017 12:34:23 +0000 Subject: [PATCH] re PR tree-optimization/82402 (error: SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be set) 2017-11-24 Richard Biener PR tree-optimization/82402 * tree-vect-loop-manip.c (create_lcssa_for_virtual_phi): Properly set SSA_NAME_OCCURS_IN_ABNORMAL_PHI. * gcc.dg/torture/pr82402.c: New testcase. From-SVN: r255140 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr82402.c | 20 ++++++++++++++++++++ gcc/tree-vect-loop-manip.c | 2 ++ 4 files changed, 33 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr82402.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b866e2512a1..acced0c72fe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-11-24 Richard Biener + + PR tree-optimization/82402 + * tree-vect-loop-manip.c (create_lcssa_for_virtual_phi): Properly + set SSA_NAME_OCCURS_IN_ABNORMAL_PHI. + 2017-11-24 Marc Glisse * match.pd (0-ptr): New transformation. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 019ff2afc2b..c43842b45f9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-11-24 Richard Biener + + PR tree-optimization/82402 + * gcc.dg/torture/pr82402.c: New testcase. + 2017-11-24 Richard Biener PR tree-optimization/83128 diff --git a/gcc/testsuite/gcc.dg/torture/pr82402.c b/gcc/testsuite/gcc.dg/torture/pr82402.c new file mode 100644 index 00000000000..cf90d5c6faf --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr82402.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +typedef int jmp_buf[1]; + +extern void exit(int) __attribute__((__noreturn__)); +extern int setjmpx(jmp_buf) __attribute__((__returns_twice__)); + +jmp_buf jbAnagram; +int a[6]; +int d; +int b () { exit (1); } +int c () { b (); } +int e () +{ + int f = 0; + for (; f < 6; f++) + a[f] = d; + c (); + setjmpx (jbAnagram); +} diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 1df591e69f2..a0d9baf0ee5 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -639,6 +639,8 @@ create_lcssa_for_virtual_phi (struct loop *loop) gimple *stmt; use_operand_p use_p; + SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_vop) + = SSA_NAME_OCCURS_IN_ABNORMAL_PHI (vop); add_phi_arg (new_phi, vop, exit_e, UNKNOWN_LOCATION); gimple_phi_set_result (new_phi, new_vop); FOR_EACH_IMM_USE_STMT (stmt, imm_iter, vop) -- 2.30.2