re PR middle-end/90840 (ICE in simplify_subreg, at simplify-rtx.c:6441)
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 7 Dec 2019 12:20:44 +0000 (12:20 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 7 Dec 2019 12:20:44 +0000 (12:20 +0000)
PR middle-end/90840
* expr.c (expand_assignment): In the case of a CONCAT on the LHS, make
sure to pass a valid inner mode in calls to simplify_gen_subreg.

From-SVN: r279076

gcc/ChangeLog
gcc/expr.c

index 0eda8e01d209360614153fc1f0fcb9f2ad7a53f7..582ffe099235ba9b57c55063648f2eaac3a1c68d 100644 (file)
@@ -1,3 +1,9 @@
+2019-12-07  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR middle-end/90840
+       * expr.c (expand_assignment): In the case of a CONCAT on the LHS, make
+       sure to pass a valid inner mode in calls to simplify_gen_subreg.
+
 2019-12-07  Tobias Burnus  <tobias@codesourcery.com>
            David Malcolm  <dmalcolm@redhat.com>
            Jakub Jelinek  <jakub@redhat.com>
index ed50586971f711552060be678c408709dbaf5154..20aa939709cd3ee64dbc6c588ed8efee19c5b657 100644 (file)
@@ -5285,13 +5285,16 @@ expand_assignment (tree to, tree from, bool nontemporal)
                }
              else
                {
+                 machine_mode from_mode
+                   = GET_MODE (result) == VOIDmode
+                     ? TYPE_MODE (TREE_TYPE (from))
+                     : GET_MODE (result);
                  rtx from_rtx;
                  if (MEM_P (result))
                    from_rtx = change_address (result, to_mode, NULL_RTX);
                  else
                    from_rtx
-                     = simplify_gen_subreg (to_mode, result,
-                                            TYPE_MODE (TREE_TYPE (from)), 0);
+                     = simplify_gen_subreg (to_mode, result, from_mode, 0);
                  if (from_rtx)
                    {
                      emit_move_insn (XEXP (to_rtx, 0),
@@ -5303,12 +5306,9 @@ expand_assignment (tree to, tree from, bool nontemporal)
                    {
                      to_mode = GET_MODE_INNER (to_mode);
                      rtx from_real
-                       = simplify_gen_subreg (to_mode, result,
-                                              TYPE_MODE (TREE_TYPE (from)),
-                                              0);
+                       = simplify_gen_subreg (to_mode, result, from_mode, 0);
                      rtx from_imag
-                       = simplify_gen_subreg (to_mode, result,
-                                              TYPE_MODE (TREE_TYPE (from)),
+                       = simplify_gen_subreg (to_mode, result, from_mode,
                                               GET_MODE_SIZE (to_mode));
                      if (!from_real || !from_imag)
                        goto concat_store_slow;