aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-04-16 09:37:44 +0200
committerRichard Biener <rguenther@suse.de>2020-04-16 12:54:38 +0200
commiteafeba3e5187a53a4c08a3285b4b220e1ab68b60 (patch)
tree130e5753d2a1ad6a56f8c33c1c51c2f13e5e7a2d /gcc
parent437eea66a4b010d8e94aa81c2b40ccf0588e5fab (diff)
downloadgcc-eafeba3e5187a53a4c08a3285b4b220e1ab68b60.zip
gcc-eafeba3e5187a53a4c08a3285b4b220e1ab68b60.tar.gz
gcc-eafeba3e5187a53a4c08a3285b4b220e1ab68b60.tar.bz2
middle-end/94614 - avoid multiword moves to nothing
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/expr.c5
-rw-r--r--gcc/lower-subreg.c4
3 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5fef2d2..9f2f5db 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/expr.c b/gcc/expr.c
index b97c217..dfbeae7 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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;
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index a170f0f..a11e535 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -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;