diff mbox series

[committed] Fix several H8 ICEs

Message ID fc551729-fa9a-0406-bd4c-ae4023d2542d@redhat.com
State New
Headers show
Series [committed] Fix several H8 ICEs | expand

Commit Message

Jeff Law Dec. 2, 2018, 6:32 p.m. UTC
When a large number of bytes are pushed in a function call sequence on
the H8, the call patterns to fail to match because they expect the
operand to be a valid HImode operand -- even when pointers are SImode.

The fact that the operand is expected to be in HImode is a bit of a
historical wart that we got away with for a long time.  This patch
changes the operand to vary between HImode and SImode based on Pmode
using the existing mode iterator.

This fixes a few dozen failures in the testsuite.  None are particularly
important and I suspect all would likely fail at runtime anyway.  But
with the RCA done on the ICE it would have been silly to not fix it
given how easy it was.

Installing on the trunk.

Jeff
commit f2787da07fe9ca9b6055b6d8f6c3e301d6678104
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Sun Dec 2 18:31:44 2018 +0000

            * config/h8300/h8300.md (call, call_value): Drop mode from
            operand containing number of bytes pushed.
            (call_insn, call_value_insn): Use mode iterator for number
            of bytes pushed operand.  Make pattern name vary appropriately.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266727 138bc75d-0d04-0410-961f-82ee72b054a4
diff mbox series

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c143ee13a48..204a9fa27c0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@ 
+2018-12-02  Jeff Law  <law@redhat.com>
+
+	* config/h8300/h8300.md (call, call_value): Drop mode from 
+	operand containing number of bytes pushed.
+	(call_insn, call_value_insn): Use mode iterator for number
+	of bytes pushed operand.  Make pattern name vary appropriately.
+
 2018-12-02  Jan Hubicka  <jh@suse.cz>
 
 	* bb-reorer.c (find_rarely_executed_basic_blocks_and_crossin_edges):
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 0686f25d71d..b3ba7e0f719 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -2066,7 +2066,7 @@ 
 
 (define_expand "call"
   [(call (match_operand:QI 0 "call_expander_operand" "")
-	 (match_operand:HI 1 "general_operand" ""))]
+	 (match_operand 1 "general_operand" ""))]
   ""
   {
     if (!register_operand (XEXP (operands[0], 0), Pmode)
@@ -2074,9 +2074,9 @@ 
       XEXP (operands[0], 0) = force_reg (Pmode, XEXP (operands[0], 0));
   })
 
-(define_insn "call_insn"
+(define_insn "call_insn_<mode>"
   [(call (mem:QI (match_operand 0 "call_insn_operand" "Cr"))
-	         (match_operand:HI 1 "general_operand" "g"))]
+	         (match_operand:P 1 "general_operand" "g"))]
   ""
 {
   rtx xoperands[1];
@@ -2103,7 +2103,7 @@ 
 (define_expand "call_value"
   [(set (match_operand 0 "" "")
 	(call (match_operand:QI 1 "call_expander_operand" "")
-	      (match_operand:HI 2 "general_operand" "")))]
+	      (match_operand 2 "general_operand" "")))]
   ""
   {
     if (!register_operand (XEXP (operands[1], 0), Pmode)
@@ -2111,10 +2111,10 @@ 
       XEXP (operands[1], 0) = force_reg (Pmode, XEXP (operands[1], 0));
   })
 
-(define_insn "call_value_insn"
+(define_insn "call_value_insn_<mode>"
   [(set (match_operand 0 "" "=r")
 	(call (mem:QI (match_operand 1 "call_insn_operand" "Cr"))
-		      (match_operand:HI 2 "general_operand" "g")))]
+		      (match_operand:P 2 "general_operand" "g")))]
   ""
 {
   rtx xoperands[2];