+#ifdef USE_MD_CONSTRAINTS
+
+/* Record just enough information about a constraint to allow checking
+ of operand constraint strings above, in validate_insn_alternatives.
+ Does not validate most properties of the constraint itself; does
+ enforce no duplicate names, no overlap with MI constraints, and no
+ prefixes. EXP is the define_*constraint form, LINENO the line number
+ reported by the reader. */
+static void
+note_constraint (rtx exp, int lineno)
+{
+ const char *name = XSTR (exp, 0);
+ unsigned int namelen = strlen (name);
+ struct constraint_data **iter, **slot, *new_cdata;
+
+ /* The 'm' constraint is special here since that constraint letter
+ can be overridden by the back end by defining the
+ TARGET_MEM_CONSTRAINT macro. */
+ if (strchr (indep_constraints, name[0]) && name[0] != 'm')
+ {
+ if (name[1] == '\0')
+ message_with_line (lineno, "constraint letter '%s' cannot be "
+ "redefined by the machine description", name);
+ else
+ message_with_line (lineno, "constraint name '%s' cannot be defined by "
+ "the machine description, as it begins with '%c'",
+ name, name[0]);
+ have_error = 1;
+ return;
+ }
+
+ slot = &constraints_by_letter_table[(unsigned int)name[0]];
+ for (iter = slot; *iter; iter = &(*iter)->next_this_letter)
+ {
+ /* This causes slot to end up pointing to the
+ next_this_letter field of the last constraint with a name
+ of equal or greater length than the new constraint; hence
+ the new constraint will be inserted after all previous
+ constraints with names of the same length. */
+ if ((*iter)->namelen >= namelen)
+ slot = iter;
+
+ if (!strcmp ((*iter)->name, name))
+ {
+ message_with_line (lineno, "redefinition of constraint '%s'", name);
+ message_with_line ((*iter)->lineno, "previous definition is here");
+ have_error = 1;
+ return;
+ }
+ else if (!strncmp ((*iter)->name, name, (*iter)->namelen))
+ {
+ message_with_line (lineno, "defining constraint '%s' here", name);
+ message_with_line ((*iter)->lineno, "renders constraint '%s' "
+ "(defined here) a prefix", (*iter)->name);
+ have_error = 1;
+ return;
+ }
+ else if (!strncmp ((*iter)->name, name, namelen))
+ {
+ message_with_line (lineno, "constraint '%s' is a prefix", name);
+ message_with_line ((*iter)->lineno, "of constraint '%s' "
+ "(defined here)", (*iter)->name);
+ have_error = 1;
+ return;
+ }
+ }
+ new_cdata = XNEWVAR (struct constraint_data, sizeof (struct constraint_data) + namelen);
+ strcpy ((char *)new_cdata + offsetof(struct constraint_data, name), name);
+ new_cdata->namelen = namelen;
+ new_cdata->lineno = lineno;
+ new_cdata->next_this_letter = *slot;
+ *slot = new_cdata;
+}
+
+/* Return the length of the constraint name beginning at position S
+ of an operand constraint string, or issue an error message if there
+ is no such constraint. Does not expect to be called for generic
+ constraints. */
+static int
+mdep_constraint_len (const char *s, int lineno, int opno)
+{
+ struct constraint_data *p;
+
+ p = constraints_by_letter_table[(unsigned int)s[0]];
+
+ if (p)
+ for (; p; p = p->next_this_letter)
+ if (!strncmp (s, p->name, p->namelen))
+ return p->namelen;
+
+ message_with_line (lineno,
+ "error: undefined machine-specific constraint "
+ "at this point: \"%s\"", s);
+ message_with_line (lineno, "note: in operand %d", opno);
+ have_error = 1;
+ return 1; /* safe */
+}
+
+#else