+2006-10-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/29091
+ * varasm.c (output_constant): If TREE_VECTOR_CST_ELTS chain is shorter than
+ the number of vector elements fill the rest with zeros.
+
2006-10-05 Richard Sandiford <richard@codesourcery.com>
* config/mips/mips.c (mips_pass_by_reference): Do not return false
+2006-10-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/29091
+ * gcc.dg/pr29091.c: New test.
+
2006-10-06 Joseph Myers <joseph@codesourcery.com>
* lib/target-supports.exp
--- /dev/null
+/* PR c/29091 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+__attribute__ ((vector_size (sizeof (int) * 4))) int a = { 1, 2 };
+int d = 3;
+__attribute__ ((vector_size (sizeof (int) * 4))) int b = { 4, 5, 6 };
+int e = 7;
+__attribute__ ((vector_size (sizeof (int) * 4))) int c = { };
+
+int
+main (void)
+{
+ int *p = (int *) &a;
+ if (p[0] != 1)
+ abort ();
+ if (p[1] != 2)
+ abort ();
+ if (p[2] != 0)
+ abort ();
+ if (p[3] != 0)
+ abort ();
+ p = (int *) &b;
+ if (p[0] != 4)
+ abort ();
+ if (p[1] != 5)
+ abort ();
+ if (p[2] != 6)
+ abort ();
+ if (p[3] != 0)
+ abort ();
+ p = (int *) &c;
+ if (p[0] != 0)
+ abort ();
+ if (p[1] != 0)
+ abort ();
+ if (p[2] != 0)
+ abort ();
+ if (p[3] != 0)
+ abort ();
+ return 0;
+}
link = TREE_VECTOR_CST_ELTS (exp);
output_constant (TREE_VALUE (link), elt_size, align);
+ thissize = elt_size;
while ((link = TREE_CHAIN (link)) != NULL)
- output_constant (TREE_VALUE (link), elt_size, nalign);
+ {
+ output_constant (TREE_VALUE (link), elt_size, nalign);
+ thissize += elt_size;
+ }
break;
}
default: