m68k: don't allow o/o in movdi, movdf, movxf

Message ID mvm4j3mm69u.fsf@suse.de
State Committed
Commit cec97549b781643f55bde34d025c3170309e3646
Headers
Series m68k: don't allow o/o in movdi, movdf, movxf |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply

Commit Message

Andreas Schwab Dec. 2, 2024, 3:52 p.m. UTC
  The movdi, movdf and movxf patterns allow both operands to be offsettable
memory, but output_move_double cannot handle overlapping objects.  This is
visible in the failure of gcc.c-torture/execute/pr97073.c when compiled
with LTO (where cprop optimizes out the AND operation; the failure also
occurs without LTO when the AND is removed).  Split the constraints so
that the operands cannot both be "o" in the same insn.

	* config/m68k/m68k.md (movdi+1, movdf+1, movxf+2): Split
	constraints so that the operands cannot both be "o".
---
 gcc/config/m68k/m68k.md | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Comments

Jeff Law Dec. 2, 2024, 5:22 p.m. UTC | #1
On 12/2/24 8:52 AM, Andreas Schwab wrote:
> The movdi, movdf and movxf patterns allow both operands to be offsettable
> memory, but output_move_double cannot handle overlapping objects.  This is
> visible in the failure of gcc.c-torture/execute/pr97073.c when compiled
> with LTO (where cprop optimizes out the AND operation; the failure also
> occurs without LTO when the AND is removed).  Split the constraints so
> that the operands cannot both be "o" in the same insn.
> 
> 	* config/m68k/m68k.md (movdi+1, movdf+1, movxf+2): Split
> 	constraints so that the operands cannot both be "o".
Thanks for taking care of this stuff!

jeff
  

Patch

diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 1c9a6bf1748..d7329004e91 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -1354,8 +1354,8 @@ 
 })
 
 (define_insn ""
-  [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,rf,rf,&rof<>")
-	(match_operand:DF 1 "general_operand" "*rf,m,0,*rofE<>"))]
+  [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,rf,rf,&rof<>,&rf<>")
+	(match_operand:DF 1 "general_operand" "*rf,m,0,*rfE<>,*rofE<>"))]
 ;  [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,&rf,&rof<>")
 ;	(match_operand:DF 1 "general_operand" "rf,m,rofF<>"))]
   "!TARGET_COLDFIRE"
@@ -1514,8 +1514,8 @@ 
   [(set_attr "flags_valid" "move")])
 
 (define_insn ""
-  [(set (match_operand:XF 0 "nonimmediate_operand" "=rm,rf,&rof<>")
-	(match_operand:XF 1 "nonimmediate_operand" "rf,m,rof<>"))]
+  [(set (match_operand:XF 0 "nonimmediate_operand" "=rm,rf,&rof<>,&rf<>")
+	(match_operand:XF 1 "nonimmediate_operand" "rf,m,rf<>,rof<>"))]
   "! TARGET_68881 && ! TARGET_COLDFIRE"
 {
   if (FP_REG_P (operands[0]))
@@ -1568,8 +1568,8 @@ 
 ;; movdi can apply to fp regs in some cases
 (define_insn ""
   ;; Let's see if it really still needs to handle fp regs, and, if so, why.
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r,&ro<>")
-	(match_operand:DI 1 "general_operand" "rF,m,roi<>F"))]
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r,&ro<>,&r<>")
+	(match_operand:DI 1 "general_operand" "rF,m,ri<>F,roi<>F"))]
 ;  [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&r,&ro<>,!&rm,!&f")
 ;	(match_operand:DI 1 "general_operand" "r,m,roi<>,fF"))]
 ;  [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&rf,&ro<>,!&rm,!&f")