This fixes the ICE seen by the ppc testcase in the PR.  The gimplifier
was blindly turning a VIEW_CONVERT_EXPR into an rvalue even if that
isn't allowed.

Bootstrap / regtest running on x86_64-unknown-linux-gnu, OK?

Can ppc folks add the testcase (maybe once they figure out the
remaining wrong-code issue)?

Thanks,
Richard.

2019-04-25  Richard Biener  <rguent...@suse.de>

        PR middle-end/89765
        * gimplify.c (gimplify_expr): Avoid turning a lvalue
        VIEW_CONVERT_EXPR into one operating on an rvalue.

Index: gcc/gimplify.c
===================================================================
--- gcc/gimplify.c      (revision 270574)
+++ 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,

Reply via email to