OSDN Git Service

PR middle-end/52419
[pf3gnuchains/gcc-fork.git] / gcc / genmodes.c
index dae7e38..8b6f5bc 100644 (file)
@@ -63,7 +63,6 @@ struct mode_data
 
   struct mode_data *component; /* mode of components */
   struct mode_data *wider;     /* next wider mode */
-  struct mode_data *wider_2x;  /* 2x wider mode */
 
   struct mode_data *contained;  /* Pointer to list of modes that have
                                   this mode as a component.  */
@@ -83,7 +82,7 @@ static struct mode_data *void_mode;
 static const struct mode_data blank_mode = {
   0, "<unknown>", MAX_MODE_CLASS,
   -1U, -1U, -1U, -1U,
-  0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0,
   "<unknown>", 0, 0, 0, 0
 };
 
@@ -790,7 +789,7 @@ calc_wider_mode (void)
 
   /* Allocate max_n_modes + 1 entries to leave room for the extra null
      pointer assigned after the qsort call below.  */
-  sortbuf = (struct mode_data **) alloca ((max_n_modes + 1) * sizeof (struct mode_data *));
+  sortbuf = XALLOCAVEC (struct mode_data *, max_n_modes + 1);
 
   for (c = 0; c < MAX_MODE_CLASS; c++)
     {
@@ -804,7 +803,6 @@ calc_wider_mode (void)
          for (prev = 0, m = modes[c]; m; m = next)
            {
              m->wider = void_mode;
-             m->wider_2x = void_mode;
 
              /* this is nreverse */
              next = m->next;
@@ -827,7 +825,6 @@ calc_wider_mode (void)
          for (j = 0; j < i; j++)
            sortbuf[j]->next = sortbuf[j]->wider = sortbuf[j + 1];
 
-
          modes[c] = sortbuf[0];
        }
     }
@@ -1062,6 +1059,21 @@ emit_mode_wider (void)
                continue;
            }
 
+         /* For vectors we want twice the number of components,
+            with the same element type.  */
+         if (m->cl == MODE_VECTOR_INT
+             || m->cl == MODE_VECTOR_FLOAT
+             || m->cl == MODE_VECTOR_FRACT
+             || m->cl == MODE_VECTOR_UFRACT
+             || m->cl == MODE_VECTOR_ACCUM
+             || m->cl == MODE_VECTOR_UACCUM)
+           {
+             if (m2->ncomponents != 2 * m->ncomponents)
+               continue;
+             if (m->component != m2->component)
+               continue;
+           }
+
          break;
        }
       if (m2 == void_mode)