https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94479
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- I still can't reproduce the issue so can you please test the following patch ontop of GCC 9? It probably applies to GCC 8 as well. Thanks. diff --git a/gcc/gimplify.c b/gcc/gimplify.c index bd8bd6d7e06..fb4a03eacd2 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -6095,7 +6095,10 @@ gimplify_addr_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) an incomplete type. Re-build ADDR_EXPRs in canonical form here. */ if (!types_compatible_p (TREE_TYPE (op0), TREE_TYPE (TREE_TYPE (expr)))) - *expr_p = build_fold_addr_expr (op0); + { + *expr_p = build_fold_addr_expr (op0); + STRIP_USELESS_TYPE_CONVERSION (*expr_p); + } /* Make sure TREE_CONSTANT and TREE_SIDE_EFFECTS are set properly. */ recompute_tree_invariant_for_addr_expr (*expr_p);