for (tail = clobbers; tail; tail = TREE_CHAIN (tail))
{
char *regname = TREE_STRING_POINTER (TREE_VALUE (tail));
- if (decode_reg_name (regname) >= 0)
+ i = decode_reg_name (regname);
+ if (i >= 0 || i == -4)
++nclobbers;
}
if (j < 0)
{
- if (j == -3)
+ if (j == -3) /* `cc', which is not a register */
continue;
+ if (j == -4) /* `memory', don't cache memory across asm */
+ {
+ XVECEXP (body, 0, i++) = gen_rtx (CLOBBER, VOIDmode, const0_rtx);
+ continue;
+ }
+
error ("unknown register name `%s' in `asm'", regname);
return;
}
\f
/* Decode an `asm' spec for a declaration as a register name.
Return the register number, or -1 if nothing specified,
- or -2 if the ASMSPEC is not `cc' and is not recognized,
- or -3 if ASMSPEC is `cc' and is not recognized.
+ or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized,
+ or -3 if ASMSPEC is `cc' and is not recognized,
+ or -4 if ASMSPEC is `memory' and is not recognized.
Accept an exact spelling or a decimal number.
Prefixes such as % are optional. */
}
#endif /* ADDITIONAL_REGISTER_NAMES */
+ if (!strcmp (asmspec, "memory"))
+ return -4;
+
if (!strcmp (asmspec, "cc"))
return -3;