From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1363) id 10D8B393A420; Tue, 25 May 2021 17:22:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10D8B393A420 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Uros Bizjak To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-8468] i386: Fix split_double_mode with paradoxical subreg [PR100626] X-Act-Checkin: gcc X-Git-Author: Uros Bizjak X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 51274fddd383524b9462530070cafcde1d34960c X-Git-Newrev: 6be2c12e37b167890d68587086a2186358b64c02 Message-Id: <20210525172203.10D8B393A420@sourceware.org> Date: Tue, 25 May 2021 17:22:03 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2021 17:22:03 -0000 https://gcc.gnu.org/g:6be2c12e37b167890d68587086a2186358b64c02 commit r11-8468-g6be2c12e37b167890d68587086a2186358b64c02 Author: Uros Bizjak Date: Tue May 18 15:45:54 2021 +0200 i386: Fix split_double_mode with paradoxical subreg [PR100626] split_double_mode calls simplify_gen_subreg, which fails for the high half of the paradoxical subreg. Return temporary register instead of NULL RTX in this case. 2021-05-18 Uroš Bizjak gcc/ PR target/100626 * config/i386/i386-expand.c (split_double_mode): Return temporary register when simplify_gen_subreg fails with the high half od the paradoxical subreg. (cherry picked from commit d39fbed75810fc7478842503ecb0268b85dc9c2e) Diff: --- gcc/config/i386/i386-expand.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c index dda08ff67f2..c16811013f1 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c @@ -154,9 +154,13 @@ split_double_mode (machine_mode mode, rtx operands[], lo_half[num] = simplify_gen_subreg (half_mode, op, GET_MODE (op) == VOIDmode ? mode : GET_MODE (op), 0); - hi_half[num] = simplify_gen_subreg (half_mode, op, - GET_MODE (op) == VOIDmode - ? mode : GET_MODE (op), byte); + + rtx tmp = simplify_gen_subreg (half_mode, op, + GET_MODE (op) == VOIDmode + ? mode : GET_MODE (op), byte); + /* simplify_gen_subreg will return NULL RTX for the + high half of the paradoxical subreg. */ + hi_half[num] = tmp ? tmp : gen_reg_rtx (half_mode); } } }