This avoids abnormals in another place.
2020-10-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/97357
* tree-ssa-loop-split.c (ssa_semi_invariant_p): Abnormal
SSA names are not semi invariant.
* gcc.dg/pr97357.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-require-effective-target indirect_jumps } */
+
+#include <setjmp.h>
+#include <stdlib.h>
+
+void * my_malloc (size_t size);
+
+typedef struct glk {
+ struct glk *nxt;
+} glk;
+
+typedef struct Lock
+{
+ glk ByteLock;
+} Lock;
+
+static Lock *l, *lk;
+
+void bytelocks(glk *rethead, jmp_buf jb)
+{
+ glk *cur, *cur_lk;
+
+ if (( _setjmp (jb)) == 0)
+ for (cur = &l->ByteLock; cur != ((glk *)0) ; cur = (cur)->nxt)
+ for (cur_lk = &lk->ByteLock; cur_lk != ((glk *)0); cur_lk = cur_lk->nxt)
+ {
+ glk *retrng;
+
+ if(!rethead)
+ rethead = (glk *) my_malloc (sizeof(glk));
+ retrng = (glk *) my_malloc (sizeof(glk));
+
+ retrng->nxt = rethead;
+ }
+
+ return;
+}
if (!def_bb || !flow_bb_inside_loop_p (loop, def_bb))
return true;
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name))
+ return false;
+
return stmt_semi_invariant_p_1 (loop, def, skip_head, stmt_stat);
}