The following makes sure to preserve control altering stmts
when removing trivially dead stmts in DSE.
2021-05-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/100398
* tree-ssa-dse.c (pass_dse::execute): Preserve control
altering stmts.
* gcc.dg/torture/pr100398.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+
+int
+test5_limit (void)
+{
+ int addr;
+
+ asm goto ("" : "+r" (addr) : : : t_err);
+ return 0;
+
+ t_err:
+ return 1;
+}
dead SSA defs. */
if (has_zero_uses (DEF_FROM_PTR (def_p))
&& !gimple_has_side_effects (stmt)
+ && !is_ctrl_altering_stmt (stmt)
&& !stmt_unremovable_because_of_non_call_eh_p (cfun, stmt))
{
if (dump_file && (dump_flags & TDF_DETAILS))