+Sun Oct 28 16:48:09 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * genrecog.c (write_switch): Output if before switch for
+ DT_elt_zero_wide_safe.
+
2001-10-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (toplev.o, halfpic.o): Depend on halfpic.h
|| type == DT_elt_one_int
|| type == DT_elt_zero_wide_safe)
{
+ const char *indent = "";
/* Pmode may not be a compile-time constant. */
if (type == DT_mode && p->tests->u.mode == Pmode)
return p;
- printf (" switch (");
+ /* We cast switch parameter to integer, so we must ensure that the value
+ fits. */
+ if (type == DT_elt_zero_wide_safe)
+ {
+ indent = " ";
+ printf(" if ((int) XWINT (x%d, 0) == XWINT (x%d, 0))\n", depth, depth);
+ }
+ printf ("%s switch (", indent);
switch (type)
{
case DT_mode:
default:
abort ();
}
- printf (")\n {\n");
+ printf (")\n%s {\n", indent);
do
{
if (p != start && p->need_label && needs_label == NULL)
needs_label = p;
- printf (" case ");
+ printf ("%s case ", indent);
switch (type)
{
case DT_mode:
default:
abort ();
}
- printf (":\n goto L%d;\n", p->success.first->number);
+ printf (":\n%s goto L%d;\n", indent, p->success.first->number);
p->success.first->need_label = 1;
p = p->next;
while (p && p->tests->type == type && !p->tests->next);
case_done:
- printf (" default:\n break;\n }\n");
+ printf ("%s default:\n%s break;\n%s }\n",
+ indent, indent, indent);
return needs_label != NULL ? needs_label : p;
}