This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
enforcing mode matching in SET
- To: egcs at cygnus dot com
- Subject: enforcing mode matching in SET
- From: John Carr <jfc at tiac dot net>
- Date: Wed, 12 Aug 1998 19:35:41 EDT
- Cc: wilson at cygnus dot com, rth at cygnus dot com, davem at dm dot cobaltmicro dot com, amylaar at cygnus dot com
The modes of the operands of SET must be the same unless one is VOIDmode.
If you think I am wrong please object; otherwise I will install the
patch below to enforce the mode requirement.
The v850, m32r, h8300, mn10200, mn10300, i960, pyr, convex, a29k, fx80,
arm, vax, rs6000, pa, dsp16xx, and romp machine descriptions are OK.
alpha, sparc, mips, m88k, sh, and i370 need to be fixed. I CC-ed the
listed maintainers; apply the patch and rebuild to see the bad definitions.
*** genrecog.c~ Thu Jun 18 11:26:37 1998
--- genrecog.c Wed Aug 12 19:18:00 1998
***************
*** 456,461 ****
--- 456,474 ----
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;