]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
middle-end/94614 - avoid multiword moves to nothing
authorRichard Biener <rguenther@suse.de>
Thu, 16 Apr 2020 07:37:44 +0000 (09:37 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 16 Apr 2020 10:54:38 +0000 (12:54 +0200)
This adjusts emit_move_multi_word to handle moves into paradoxical
subregs parts that are not there and adjusts lower-subregs
CLOBBER resolving to deal with those as well.

2020-04-16  Richard Biener  <rguenther@suse.de>

PR middle-end/94614
* expr.c (emit_move_multi_word): Do not generate code when
the destination part is undefined_operand_subword_p.
* lower-subreg.c (resolve_clobber): Look through a paradoxica
subreg.

gcc/ChangeLog
gcc/expr.c
gcc/lower-subreg.c

index 5fef2d26d882bed3aaa8d1ed983d506efdcb6d31..9f2f5db6f2f9284faf4a8e6ba74521a08105ac48 100644 (file)
@@ -1,3 +1,11 @@
+2020-04-16  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/94614
+       * expr.c (emit_move_multi_word): Do not generate code when
+       the destination part is undefined_operand_subword_p.
+       * lower-subreg.c (resolve_clobber): Look through a paradoxica
+       subreg.
+
 2020-04-16  Martin Jambor  <mjambor@suse.cz>
 
        PR tree-optimization/94598
index b97c217e86da73401a04f3c4fc531d83987e8d5d..dfbeae71518f6b5381a42877013ac21ad657f621 100644 (file)
@@ -3692,6 +3692,11 @@ emit_move_multi_word (machine_mode mode, rtx x, rtx y)
   need_clobber = false;
   for (i = 0; i < CEIL (mode_size, UNITS_PER_WORD); i++)
     {
+      /* Do not generate code for a move if it would go entirely
+        to the non-existing bits of a paradoxical subreg.  */
+      if (undefined_operand_subword_p (x, i))
+       continue;
+
       rtx xpart = operand_subword (x, i, 1, mode);
       rtx ypart;
 
index a170f0ff93b8f5a8f0c08c6361fa262495bbb655..a11e535b5bfb2006e12f46a2d4b655f6fe06e093 100644 (file)
@@ -1150,6 +1150,10 @@ resolve_clobber (rtx pat, rtx_insn *insn)
   int ret;
 
   reg = XEXP (pat, 0);
+  /* For clobbers we can look through paradoxical subregs which
+     we do not handle in simplify_gen_subreg_concatn.  */
+  if (paradoxical_subreg_p (reg))
+    reg = SUBREG_REG (reg);
   if (!resolve_reg_p (reg) && !resolve_subreg_p (reg))
     return false;