When __AVR_ERRATA_SKIP_JMP_CALL__ is defined, then XJMP and XCALL
instructions should not be skipped due to a core erratum.
Applied as obvious.
Johann
--
PR target/127024
libgcc/config/avr/libf7/
* libf7-asm.sx (to_integer): Don't skip XJMP
if __AVR_ERRATA_SKIP_JMP_CALL__. AVR: target/127024 - Fix build warning: skipping two-word instruction
When __AVR_ERRATA_SKIP_JMP_CALL__ is defined, then XJMP and XCALL
instructions should not be skipped due to a core erratum.
libgcc/config/avr/libf7/
PR target/127024
* libf7-asm.sx (to_integer): Don't skip XJMP
if __AVR_ERRATA_SKIP_JMP_CALL__.
diff --git a/libgcc/config/avr/libf7/libf7-asm.sx b/libgcc/config/avr/libf7/libf7-asm.sx
index c5040fd14cf..f96c2a73d58 100644
--- a/libgcc/config/avr/libf7/libf7-asm.sx
+++ b/libgcc/config/avr/libf7/libf7-asm.sx
@@ -602,12 +602,21 @@ DEFUN to_integer
brmi .Lsaturate.T ; > INTxx_MAX => saturate
brtc 9f ; >= 0 => return
+#ifdef __AVR_ERRATA_SKIP_JMP_CALL__
+ ;; Some cores have a problem skipping 2-word instructions.
+ sbrs Mask, 5
+ rjmp 0f
+ XJMP __negdi2
+0: sbrs Mask, 4
+ rjmp 1f
+ XJMP __negsi2
+1:
+#else
sbrc Mask, 5
- .global __negdi2
XJMP __negdi2
sbrc Mask, 4
- .global __negsi2
XJMP __negsi2
+#endif /* __AVR_ERRATA_SKIP_JMP_CALL__ */
neg C6
neg C5
sbci C6, 0