PR tree-optimization/21105
* c-decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE in
TREE_OVERFLOW check.
* gcc.dg/large-size-array.c: New.
From-SVN: r103164
+2005-08-16 James E Wilson <wilson@specifix.com>
+
+ PR tree-optimization/21105
+ * c-decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE in
+ TREE_OVERFLOW check.
+
2005-08-16 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.md (ltu<mode>): Convert to mode macro.
if (TREE_CODE (type) == ARRAY_TYPE
&& COMPLETE_TYPE_P (type)
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && TREE_OVERFLOW (TYPE_SIZE (type)))
+ && TREE_OVERFLOW (TYPE_SIZE_UNIT (type)))
{
error ("size of array %qs is too large", name);
/* If we proceed with the array type as it is, we'll eventually
+2005-08-16 James E Wilson <wilson@specifix.com>
+
+ PR tree-optimization/21105
+ * gcc.dg/large-size-array.c: New.
+
2005-08-16 Dorit Nuzman <dorit@il.ibm.com>
* gcc.dg/vect/vect-40: Use aligned arrays instead of arrays to aligned
--- /dev/null
+/* { dg-do compile } */
+#include <limits.h>
+
+#ifdef __LP64__
+#define DIM UINT_MAX>>1
+#else
+#define DIM USHORT_MAX>>1
+#endif
+
+int
+sub (int *a)
+{
+ return a[0];
+}
+
+int
+main (void)
+{
+ int a[DIM][DIM]; /* { dg-error "size of array 'a' is too large" } */
+ return sub (&a[0][0]);
+}