The following testcase ICEs because the objsz pass calls replace_uses_by
on SSA_NAME_OCCURS_IN_ABNORMAL_PHI SSA_NAME. The following patch instead
of that calls replace_call_with_value, which will turn it into
xyz_123(ab) = 234;
2020-04-01 Jakub Jelinek <jakub@redhat.com>
PR middle-end/94423
* tree-object-size.c (pass_object_sizes::execute): Don't call
replace_uses_by for SSA_NAME_OCCURS_IN_ABNORMAL_PHI lhs, instead
call replace_call_with_value.
* gcc.dg/ubsan/pr94423.c: New test.
+2020-04-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/94423
+ * tree-object-size.c (pass_object_sizes::execute): Don't call
+ replace_uses_by for SSA_NAME_OCCURS_IN_ABNORMAL_PHI lhs, instead
+ call replace_call_with_value.
+
2020-04-01 Kewen Lin <linkw@gcc.gnu.org>
PR tree-optimization/94043
+2020-04-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/94423
+ * gcc.dg/ubsan/pr94423.c: New test.
+
2020-04-01 Kewen Lin <linkw@gcc.gnu.org>
PR tree-optimization/94043
--- /dev/null
+/* PR middle-end/94423 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsanitize=object-size" } */
+
+void foo (void);
+typedef struct { long buf[22]; } jmp_buf[1];
+extern int sigsetjmp (jmp_buf, int) __attribute__ ((__nothrow__));
+jmp_buf buf;
+
+void
+bar (int *c)
+{
+ while (*c)
+ foo ();
+ while (*c)
+ sigsetjmp (buf, 0);
+}
}
/* Propagate into all uses and fold those stmts. */
- replace_uses_by (lhs, result);
+ if (!SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ replace_uses_by (lhs, result);
+ else
+ replace_call_with_value (&i, result);
}
}