This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: requested array too large for target


Tom Tromey <tromey@redhat.com> writes:

> I don't understand this error since I don't see an array there.

The real location of the decl has been lost because it probably didn't
matter, so the line number is incorrect. I just updated my tree to
chase an other problem and I got this too. For example:

/home/apbianco/src/egcs-devel/libjava/java/lang/Throwable.java:169: requested array
 too large for target

Which actually shows you that gcc doesn't like the way we handle empty
arrays because we give them a size of -1 which was the way to go until
now AFAIR:

    java/lang/Throwable.java:
    169   private transient byte stackTrace[];

I'm just going to revert Jeff's patch to keep on working...

./A

        * stor-layout.c (layout_type): Complain if an array's size can
        not be represented in a size_t.

Index: stor-layout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stor-layout.c,v
retrieving revision 1.104
retrieving revision 1.103
diff -u -p -r1.104 -r1.103
--- stor-layout.c       2001/09/05 13:16:44     1.104
+++ stor-layout.c       2001/08/22 14:35:48     1.103
@@ -1442,19 +1442,6 @@ layout_type (type)
            if (TYPE_SIZE_UNIT (element) != 0 && ! integer_onep (element_size))
              TYPE_SIZE_UNIT (type)
                = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (element), length);
-
-           /* Complain if the user has requested an array too large to
-              fit in size_t.  */
-           if (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
-               && TREE_OVERFLOW (TYPE_SIZE (type)))
-             {
-               error ("requested array too large for target");
-
-               /* Avoid crashing later.  */
-               TYPE_SIZE (type) = element_size;
-               if (TYPE_SIZE_UNIT (type))
-                 TYPE_SIZE_UNIT (type) = TYPE_SIZE_UNIT (element);
-             }
          }
 
        /* Now round the alignment and size,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]