aboutsummaryrefslogtreecommitdiff
path: root/gcc/genrecog.c
diff options
context:
space:
mode:
authorJohn Carr <jfc@mit.edu>1998-08-14 13:52:58 +0000
committerJohn Carr <jfc@gcc.gnu.org>1998-08-14 13:52:58 +0000
commit141dba98fdd28e263dbdf626ee97dd5cf70d3d86 (patch)
tree4288ececcad084d17e2667a706c700f7d2e2e1ed /gcc/genrecog.c
parent64c7a80a984541525bcb3b23213a8e9c9bcb4807 (diff)
downloadgcc-141dba98fdd28e263dbdf626ee97dd5cf70d3d86.zip
gcc-141dba98fdd28e263dbdf626ee97dd5cf70d3d86.tar.gz
gcc-141dba98fdd28e263dbdf626ee97dd5cf70d3d86.tar.bz2
genrecog.c (add_to_sequence): Fatal error if the modes of the operands of SET are incompatible.
* genrecog.c (add_to_sequence): Fatal error if the modes of the operands of SET are incompatible. * alpha.md: Fix max and min patterns so modes of SET operands match. From-SVN: r21731
Diffstat (limited to 'gcc/genrecog.c')
-rw-r--r--gcc/genrecog.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index a4b14e3..4dd5ec7 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -456,6 +456,19 @@ add_to_sequence (pattern, last, position)
goto restart;
case SET:
+ /* The operands of a SET must have the same mode unless one is VOIDmode. */
+ if (GET_MODE (SET_SRC (pattern)) != VOIDmode
+ && GET_MODE (SET_DEST (pattern)) != VOIDmode
+ && GET_MODE (SET_SRC (pattern)) != GET_MODE (SET_DEST (pattern))
+ /* The mode of an ADDRESS_OPERAND is the mode of the memory reference,
+ not the mode of the address. */
+ && ! (GET_CODE (SET_SRC (pattern)) == MATCH_OPERAND
+ && ! strcmp (XSTR (SET_SRC (pattern), 1), "address_operand")))
+ {
+ print_rtl (stderr, pattern);
+ fputc ('\n', stderr);
+ fatal ("mode mismatch in SET");
+ }
newpos[depth] = '0';
new = add_to_sequence (SET_DEST (pattern), &new->success, newpos);
this->success.first->enforce_mode = 1;