This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [committed] C front end fix for PR 21105


Richard Kenner wrote:
> It should be the case that TYPE_SIZE is an INTEGER_CST iff TYPE_SIZE_UNIT
> is, but it still looks odd to be testing different fields here.

Good point.  My last patch was sloppy.  I checked in this patch to fix it.

This was tested with an x86_64-linux C only bootstrap and make check.
There were no regressions.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com
2005-08-17  James E Wilson  <wilson@specifix.com>

	* c-decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE in
	array size check.

Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.681
diff -p -p -r1.681 c-decl.c
*** c-decl.c	16 Aug 2005 18:23:48 -0000	1.681
--- c-decl.c	18 Aug 2005 00:17:28 -0000
*************** grokdeclarator (const struct c_declarato
*** 4383,4389 ****
  
    if (TREE_CODE (type) == ARRAY_TYPE
        && COMPLETE_TYPE_P (type)
!       && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
        && TREE_OVERFLOW (TYPE_SIZE_UNIT (type)))
      {
        error ("size of array %qs is too large", name);
--- 4383,4389 ----
  
    if (TREE_CODE (type) == ARRAY_TYPE
        && COMPLETE_TYPE_P (type)
!       && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST
        && TREE_OVERFLOW (TYPE_SIZE_UNIT (type)))
      {
        error ("size of array %qs is too large", name);

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