expr.c (expand_expr_real_1): Avoid gimple_assign_rhs_to_tree during TER and instead...
authorRichard Biener <rguenther@suse.de>
Thu, 24 Apr 2014 08:55:05 +0000 (08:55 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 24 Apr 2014 08:55:05 +0000 (08:55 +0000)
2014-04-24  Richard Biener  <rguenther@suse.de>

* expr.c (expand_expr_real_1): Avoid gimple_assign_rhs_to_tree
during TER and instead use the sepops interface for expanding
non-GIMPLE_SINGLE_RHS.

From-SVN: r209741

gcc/ChangeLog
gcc/expr.c

index 21a5b3e3f1cbbebfa1628ca2275ecf54a86afdaf..591179a50bb6afcec5353f7d8572b583cfbfd6e3 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-24  Richard Biener  <rguenther@suse.de>
+
+       * expr.c (expand_expr_real_1): Avoid gimple_assign_rhs_to_tree
+       during TER and instead use the sepops interface for expanding
+       non-GIMPLE_SINGLE_RHS.
+
 2014-04-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * config/i386/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Only redefine
index 72e440119e433197d6a322e36afcdf1edd6db708..825a244b09afe3de57106bae17619af5752b32b1 100644 (file)
@@ -9395,12 +9395,33 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
       if (g)
        {
          rtx r;
-         location_t saved_loc = curr_insn_location ();
-
-         set_curr_insn_location (gimple_location (g));
-         r = expand_expr_real (gimple_assign_rhs_to_tree (g), target,
-                               tmode, modifier, NULL, inner_reference_p);
-         set_curr_insn_location (saved_loc);
+         ops.code = gimple_assign_rhs_code (g);
+          switch (get_gimple_rhs_class (ops.code))
+           {
+           case GIMPLE_TERNARY_RHS:
+             ops.op2 = gimple_assign_rhs3 (g);
+             /* Fallthru */
+           case GIMPLE_BINARY_RHS:
+             ops.op1 = gimple_assign_rhs2 (g);
+             /* Fallthru */
+           case GIMPLE_UNARY_RHS:
+             ops.op0 = gimple_assign_rhs1 (g);
+             ops.type = TREE_TYPE (gimple_assign_lhs (g));
+             ops.location = gimple_location (g);
+             r = expand_expr_real_2 (&ops, target, tmode, modifier);
+             break;
+           case GIMPLE_SINGLE_RHS:
+             {
+               location_t saved_loc = curr_insn_location ();
+               set_curr_insn_location (gimple_location (g));
+               r = expand_expr_real (gimple_assign_rhs1 (g), target,
+                                     tmode, modifier, NULL, inner_reference_p);
+               set_curr_insn_location (saved_loc);
+               break;
+             }
+           default:
+             gcc_unreachable ();
+           }
          if (REG_P (r) && !REG_EXPR (r))
            set_reg_attrs_for_decl_rtl (SSA_NAME_VAR (exp), r);
          return r;