https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89765

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think the issue is that we gimplify

VIEW_CONVERT_EXPR<__int128 unsigned>(<<< Unknown tree: compound_literal_expr
    V D.2833 = y; >>>)

via

12399           case VIEW_CONVERT_EXPR:
12400             if (is_gimple_reg_type (TREE_TYPE (*expr_p))
12401                 && is_gimple_reg_type (TREE_TYPE (TREE_OPERAND (*expr_p,
0))))
12402               {
12403                 ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
12404                                      post_p, is_gimple_val, fb_rvalue);
(gdb) l
12405                 recalculate_side_effects (*expr_p);
12406                 break;

when in gimplify_expr with fallback == fb_lvalue and gimple_test_f ==
is_gimple_lvalue.  If we fix that with

Index: gcc/gimplify.c
===================================================================
--- gcc/gimplify.c      (revision 270437)
+++ gcc/gimplify.c      (working copy)
@@ -12397,7 +12397,8 @@ gimplify_expr (tree *expr_p, gimple_seq
          break;

        case VIEW_CONVERT_EXPR:
-         if (is_gimple_reg_type (TREE_TYPE (*expr_p))
+         if ((fallback & fb_rvalue)
+             && is_gimple_reg_type (TREE_TYPE (*expr_p))
              && is_gimple_reg_type (TREE_TYPE (TREE_OPERAND (*expr_p, 0))))
            {
              ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,

then we gimplify to the correct

  VIEW_CONVERT_EXPR<__int128 unsigned>(D.2833) = x;

and yes, we could move the VIEW_CONVERT_EXPR to the RHS as a trick to make
D.2833 SSA rewritable in update-address-taken.

Have to think whether requiring fallback & fb_rvalue is to be used or
if fallback != fb_lvalue is better.  I guess the latter.

Reply via email to