From 98a05c03ef5a3f3f096b1c344e6a75c37fbeea47 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 8 Feb 2018 13:50:16 +0000 Subject: [PATCH] Simplify LRA lowpart subreg fix r257177 made the else arms equivalent to the if arms. 2018-02-08 Richard Sandiford gcc/ * lra-constraints.c (match_reload): Unconditionally use gen_lowpart_SUBREG, rather than selecting between that and equivalent gen_rtx_SUBREG code. From-SVN: r257488 --- gcc/ChangeLog | 6 ++++++ gcc/lra-constraints.c | 16 ++-------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f26472ada03..803e0305c2a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-02-08 Richard Sandiford + + * lra-constraints.c (match_reload): Unconditionally use + gen_lowpart_SUBREG, rather than selecting between that + and equivalent gen_rtx_SUBREG code. + 2018-02-08 Richard Biener PR tree-optimization/84233 diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 4f5474ebce1..125bbb6c02b 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -942,13 +942,7 @@ match_reload (signed char out, signed char *ins, signed char *outs, reg = new_in_reg = lra_create_new_reg_with_unique_value (inmode, in_rtx, goal_class, ""); - if (SCALAR_INT_MODE_P (inmode)) - new_out_reg = gen_lowpart_SUBREG (outmode, reg); - else - { - poly_uint64 offset = subreg_lowpart_offset (outmode, inmode); - new_out_reg = gen_rtx_SUBREG (outmode, reg, offset); - } + new_out_reg = gen_lowpart_SUBREG (outmode, reg); LRA_SUBREG_P (new_out_reg) = 1; /* If the input reg is dying here, we can use the same hard register for REG and IN_RTX. We do it only for original @@ -965,13 +959,7 @@ match_reload (signed char out, signed char *ins, signed char *outs, reg = new_out_reg = lra_create_new_reg_with_unique_value (outmode, out_rtx, goal_class, ""); - if (SCALAR_INT_MODE_P (outmode)) - new_in_reg = gen_lowpart_SUBREG (inmode, reg); - else - { - poly_uint64 offset = subreg_lowpart_offset (inmode, outmode); - new_in_reg = gen_rtx_SUBREG (inmode, reg, offset); - } + new_in_reg = gen_lowpart_SUBREG (inmode, reg); /* NEW_IN_REG is non-paradoxical subreg. We don't want NEW_OUT_REG living above. We add clobber clause for this. This is just a temporary clobber. We can remove -- 2.30.2