From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1035) id 609903858D20; Tue, 5 Mar 2024 17:35:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 609903858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709660123; bh=Y+Eb+1QKow2WoHG0vvi5fMU21FHjz7SAJVuPkLBOTeU=; h=From:To:Subject:Date:From; b=HRXci+FawxI8P2WSI8AR7oFsGkFNdQ7EBXODzx+LGxK37VQcs0Ne6isU6SPeIaxwb JyZ48O7Vrx7xeZapUPT2GOQOP6eHOXSSpTVZrJZixJKjV71XPCKPEm8gRAc0nURplo Rkh7Th4bvrUn28DkQ7+QckftzSY04kqFvk2KVGvQ= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Earnshaw To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-9322] arm: check for low register before applying peephole [PR113510] X-Act-Checkin: gcc X-Git-Author: Richard Earnshaw X-Git-Refname: refs/heads/master X-Git-Oldrev: 2ba3171f161452df476485272cc966bc523d9859 X-Git-Newrev: 067a012bde15bfb62d9af309d9d524ebfe91b705 Message-Id: <20240305173523.609903858D20@sourceware.org> Date: Tue, 5 Mar 2024 17:35:23 +0000 (GMT) List-Id: https://gcc.gnu.org/g:067a012bde15bfb62d9af309d9d524ebfe91b705 commit r14-9322-g067a012bde15bfb62d9af309d9d524ebfe91b705 Author: Richard Earnshaw Date: Tue Mar 5 17:21:43 2024 +0000 arm: check for low register before applying peephole [PR113510] For thumb1, when using a peephole to fuse mov reg, #const add reg, reg, SP into add reg, SP, #const we must first check that reg is a low register, otherwise we will ICE when trying to recognize the resulting insn. gcc/ChangeLog: PR target/113510 * config/arm/thumb1.md (peephole2 to fuse mov imm/add SP): Use low_register_operand. Diff: --- gcc/config/arm/thumb1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/arm/thumb1.md b/gcc/config/arm/thumb1.md index 14d6df580af..d7074b43f60 100644 --- a/gcc/config/arm/thumb1.md +++ b/gcc/config/arm/thumb1.md @@ -113,7 +113,7 @@ ;; Reloading and elimination of the frame pointer can ;; sometimes cause this optimization to be missed. (define_peephole2 - [(set (match_operand:SI 0 "arm_general_register_operand" "") + [(set (match_operand:SI 0 "low_register_operand" "") (match_operand:SI 1 "const_int_operand" "")) (set (match_dup 0) (plus:SI (match_dup 0) (reg:SI SP_REGNUM)))]