https://gcc.gnu.org/g:856f6de5d19257e3c5802a250e7c749ca44beee3

commit r16-777-g856f6de5d19257e3c5802a250e7c749ca44beee3
Author: Richard Sandiford <richard.sandif...@arm.com>
Date:   Wed May 21 10:01:26 2025 +0100

    xstormy16: Avoid accessing beyond the operands[] array
    
    The negsi2 C++ code writes to operands[2] even though the pattern
    has no operand 2.
    
    gcc/
            * config/stormy16/stormy16.md (negsi2): Remove unused assignment.

Diff:
---
 gcc/config/stormy16/stormy16.md | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/config/stormy16/stormy16.md b/gcc/config/stormy16/stormy16.md
index 70c82827a4ac..15c60ad03880 100644
--- a/gcc/config/stormy16/stormy16.md
+++ b/gcc/config/stormy16/stormy16.md
@@ -702,8 +702,7 @@
   [(parallel [(set (match_operand:SI 0 "register_operand" "")
                   (neg:SI (match_operand:SI 1 "register_operand" "")))
              (clobber (reg:BI CARRY_REG))])]
-  ""
-  { operands[2] = gen_reg_rtx (HImode); })
+  "")
 
 (define_insn_and_split "*negsi2_internal"
   [(set (match_operand:SI 0 "register_operand" "=&r")

Reply via email to