[committed] Fix minor length computation on stormy16

Message ID a6ba6cf3-00a5-6ba4-9796-5154cdbfcf15@gmail.com
State Committed
Commit 148de3aaac6d2b66c635c76d245c7cd1537fa4e0
Headers
Series [committed] Fix minor length computation on stormy16 |

Commit Message

Jeff Law May 8, 2023, 2:30 p.m. UTC
  Today's build of xstormy16-elf failed due to a branch to an out of range 
target.  Manual inspection of the assembly code for the affected 
function (divdi3) showed that the zero-extension patterns were claiming 
a length of 2, but clearly assembled into 4 bytes.

This patch adds an explicit length to the zero extension pattern and 
appears to resolve the issue in my test builds.

Committed to the trunk,

Jeff
commit 148de3aaac6d2b66c635c76d245c7cd1537fa4e0
Author: Jeff Law <jlaw@ventanamicro>
Date:   Mon May 8 08:28:26 2023 -0600

    Fix minor length computation on stormy16
    
    Today's build of xstormy16-elf failed due to a branch to an out of range
    target.  Manual inspection of the assembly code for the affected function
    (divdi3) showed that the zero-extension patterns were claiming a length
    of 2, but clearly assembled into 4 bytes.
    
    This patch adds an explicit length to the zero extension pattern and
    appears to resolve the issue in my test builds.
    
    gcc/
    
            * config/stormy16/stormy16.md (zero_extendhisi2): Fix length.
  

Patch

diff --git a/gcc/config/stormy16/stormy16.md b/gcc/config/stormy16/stormy16.md
index 91e4bb1cff7..430ec297e5a 100644
--- a/gcc/config/stormy16/stormy16.md
+++ b/gcc/config/stormy16/stormy16.md
@@ -299,7 +299,8 @@  (define_insn "zero_extendhisi2"
 	(zero_extend:SI (match_operand:HI 1 "register_operand" "0")))]
   ""
   "mov %h0,#0"
-  [(set_attr "psw_operand" "clobber")])
+  [(set_attr "length" "4")
+   (set_attr "psw_operand" "clobber")])
 
 ;; ::::::::::::::::::::
 ;; ::