http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58805
vries at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vries at gcc dot gnu.org --- Comment #11 from vries at gcc dot gnu.org --- Using this tentative patch, tree-tail-merge leaves the test-case alone: ... diff --git a/gcc/gimple.c b/gcc/gimple.c index 3ddceb9..7e00037 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -2394,6 +2394,13 @@ gimple_copy (gimple stmt) return copy; } +static bool +return_true_bool_gimple_tree_voidptr (gimple s ATTRIBUTE_UNUSED, + tree t ATTRIBUTE_UNUSED, + void *p ATTRIBUTE_UNUSED) +{ + return true; +} /* Return true if statement S has side-effects. We consider a statement to have side effects if: @@ -2413,9 +2420,16 @@ gimple_has_side_effects (const_gimple s) if (gimple_has_volatile_ops (s)) return true; - if (gimple_code (s) == GIMPLE_ASM - && gimple_asm_volatile_p (s)) - return true; + if (gimple_code (s) == GIMPLE_ASM) + { + if (gimple_asm_volatile_p (s)) + return true; + + if (walk_stmt_load_store_addr_ops ((gimple)s, NULL, NULL, + return_true_bool_gimple_tree_voidptr, + NULL)) + return true; + } if (is_gimple_call (s)) { ...